|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.hibernate.collection.PersistentCollection net.sf.hibernate.collection.ODMGCollection net.sf.hibernate.collection.Bag
An unordered, unkeyed collection that can contain the same element multiple times. The Java collections API, curiously, has no Bag. Most developers seem to use Lists to represent bag semantics, so Hibernate follows this practice.
Constructor Summary | |
Bag()
|
|
Bag(SessionImplementor session)
|
|
Bag(SessionImplementor session,
Collection coll)
|
Method Summary | |
void |
add(int i,
Object o)
|
boolean |
add(Object o)
|
boolean |
addAll(Collection c)
|
boolean |
addAll(int i,
Collection c)
|
void |
beforeInitialize(CollectionPersister persister)
Called before any elements are read into the collection, allowing appropriate initializations to occur. |
void |
clear()
|
boolean |
contains(Object o)
|
boolean |
containsAll(Collection c)
|
void |
delayedAddAll(Collection c)
After reading all existing elements from the database, add the queued elements to the underlying collection. |
org.odmg.DBag |
difference(org.odmg.DBag otherBag)
|
Serializable |
disassemble(CollectionPersister persister)
Disassemble the collection, ready for the cache |
boolean |
empty()
Is the initialized collection empty? |
Iterator |
entries()
Iterate all collection entries, during update of the database |
boolean |
entryExists(Object entry,
int i)
Does an element exist at this entry in the collection? |
boolean |
equals(Object obj)
Bag does not respect the collection API and do an JVM instance comparison to do the equals. |
boolean |
equalsSnapshot(Type elementType)
Does the current state exactly match the snapshot? |
Object |
get(int i)
|
Iterator |
getDeletes(Type elemType)
Get all the elements that need deleting |
Object |
getIndex(Object entry,
int i)
Get the index of the given collection entry |
Collection |
getOrphans(Serializable snapshot)
get all "orphaned" elements |
int |
hashCode()
|
int |
indexOf(Object o)
|
void |
initializeFromCache(CollectionPersister persister,
Serializable disassembled,
Object owner)
Read the state of the collection from a disassembled cached value |
org.odmg.DBag |
intersection(org.odmg.DBag otherBag)
|
boolean |
isEmpty()
|
boolean |
isWrapper(Object collection)
Is this the wrapper for the given underlying collection instance? |
Iterator |
iterator()
|
int |
lastIndexOf(Object o)
|
ListIterator |
listIterator()
|
ListIterator |
listIterator(int i)
|
boolean |
needsInserting(Object entry,
int i,
Type elemType)
Do we need to insert this element? |
boolean |
needsRecreate(CollectionPersister persister)
Do we need to completely recreate this collection when it changes? |
boolean |
needsUpdating(Object entry,
int i,
Type elemType)
Do we need to update this element? |
int |
occurrences(Object o)
|
Object |
readFrom(ResultSet rs,
CollectionPersister persister,
Object owner)
Read a row from the JDBC result set |
Object |
remove(int i)
|
boolean |
remove(Object o)
|
boolean |
removeAll(Collection c)
|
boolean |
retainAll(Collection c)
|
Object |
set(int i,
Object o)
|
int |
size()
|
protected Serializable |
snapshot(CollectionPersister persister)
Return a new snapshot of the current state |
List |
subList(int start,
int end)
|
Object[] |
toArray()
|
Object[] |
toArray(Object[] a)
|
String |
toString()
|
org.odmg.DBag |
union(org.odmg.DBag otherBag)
|
void |
writeTo(PreparedStatement st,
CollectionPersister persister,
Object entry,
int i,
boolean writeOrder)
Write a row to the JDBC prepared statement |
Methods inherited from class net.sf.hibernate.collection.ODMGCollection |
existsElement, query, select, selectElement |
Methods inherited from class net.sf.hibernate.collection.PersistentCollection |
afterRowInsert, beginRead, endRead, forceInitialization, getCollectionSnapshot, getOrphans, getSession, getSnapshot, getSnapshot, getValue, hasQueuedAdditions, initialize, isDirectlyAccessible, postFlush, preInsert, queueAdd, queueAddAll, queuedAdditionIterator, read, setCollectionSnapshot, setCurrentSession, setDirectlyAccessible, setInitialized, unsetSession, wasInitialized, write |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.odmg.DCollection |
existsElement, query, select, selectElement |
Constructor Detail |
public Bag(SessionImplementor session)
public Bag(SessionImplementor session, Collection coll)
public Bag()
Method Detail |
public boolean isWrapper(Object collection)
PersistentCollection
isWrapper
in class PersistentCollection
public boolean empty()
PersistentCollection
empty
in class PersistentCollection
public Iterator entries()
PersistentCollection
entries
in class PersistentCollection
PersistentCollection.entries()
public Object readFrom(ResultSet rs, CollectionPersister persister, Object owner) throws HibernateException, SQLException
PersistentCollection
readFrom
in class PersistentCollection
public void writeTo(PreparedStatement st, CollectionPersister persister, Object entry, int i, boolean writeOrder) throws HibernateException, SQLException
PersistentCollection
writeTo
in class PersistentCollection
public void beforeInitialize(CollectionPersister persister)
PersistentCollection
beforeInitialize
in class PersistentCollection
public boolean equalsSnapshot(Type elementType) throws HibernateException
PersistentCollection
equalsSnapshot
in class PersistentCollection
protected Serializable snapshot(CollectionPersister persister) throws HibernateException
PersistentCollection
snapshot
in class PersistentCollection
public Collection getOrphans(Serializable snapshot) throws HibernateException
PersistentCollection
getOrphans
in class PersistentCollection
HibernateException
public Serializable disassemble(CollectionPersister persister) throws HibernateException
PersistentCollection
disassemble
in class PersistentCollection
public void initializeFromCache(CollectionPersister persister, Serializable disassembled, Object owner) throws HibernateException
PersistentCollection
initializeFromCache
in class PersistentCollection
HibernateException
public boolean needsRecreate(CollectionPersister persister)
PersistentCollection
needsRecreate
in class PersistentCollection
public Iterator getDeletes(Type elemType) throws HibernateException
PersistentCollection
getDeletes
in class PersistentCollection
HibernateException
public boolean needsInserting(Object entry, int i, Type elemType) throws HibernateException
PersistentCollection
needsInserting
in class PersistentCollection
HibernateException
public boolean needsUpdating(Object entry, int i, Type elemType)
PersistentCollection
needsUpdating
in class PersistentCollection
public int size()
size
in interface Collection
Collection.size()
public boolean isEmpty()
isEmpty
in interface Collection
Collection.isEmpty()
public boolean contains(Object o)
contains
in interface Collection
Collection.contains(Object)
public Iterator iterator()
iterator
in interface Collection
Collection.iterator()
public Object[] toArray()
toArray
in interface Collection
Collection.toArray()
public Object[] toArray(Object[] a)
toArray
in interface Collection
Collection.toArray(Object[])
public boolean add(Object o)
add
in interface Collection
Collection.add(Object)
public boolean remove(Object o)
remove
in interface Collection
Collection.remove(Object)
public boolean containsAll(Collection c)
containsAll
in interface Collection
Collection.containsAll(Collection)
public boolean addAll(Collection c)
addAll
in interface Collection
Collection.addAll(Collection)
public void delayedAddAll(Collection c)
PersistentCollection
delayedAddAll
in class PersistentCollection
public boolean removeAll(Collection c)
removeAll
in interface Collection
Collection.removeAll(Collection)
public boolean retainAll(Collection c)
retainAll
in interface Collection
Collection.retainAll(Collection)
public void clear()
clear
in interface Collection
Collection.clear()
public Object getIndex(Object entry, int i)
PersistentCollection
getIndex
in class PersistentCollection
public org.odmg.DBag difference(org.odmg.DBag otherBag)
difference
in interface org.odmg.DBag
public org.odmg.DBag intersection(org.odmg.DBag otherBag)
intersection
in interface org.odmg.DBag
public int occurrences(Object o)
occurrences
in interface org.odmg.DBag
public org.odmg.DBag union(org.odmg.DBag otherBag)
union
in interface org.odmg.DBag
public void add(int i, Object o)
List.add(int, Object)
public boolean addAll(int i, Collection c)
List.addAll(int, Collection)
public Object get(int i)
List.get(int)
public int indexOf(Object o)
List.indexOf(Object)
public int lastIndexOf(Object o)
lastIndexOf
in interface List
List.lastIndexOf(Object)
public ListIterator listIterator()
listIterator
in interface List
List.listIterator()
public ListIterator listIterator(int i)
listIterator
in interface List
List.listIterator(int)
public Object remove(int i)
List.remove(int)
public Object set(int i, Object o)
List.set(int, Object)
public List subList(int start, int end)
List.subList(int, int)
public String toString()
public boolean entryExists(Object entry, int i)
PersistentCollection
entryExists
in class PersistentCollection
public boolean equals(Object obj)
equals
in interface Collection
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in interface Collection
Object.hashCode()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |