|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.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 PersistentCollectionpublic boolean empty()
PersistentCollection
empty in class PersistentCollectionpublic Iterator entries()
PersistentCollection
entries in class PersistentCollectionPersistentCollection.entries()public Object readFrom(ResultSet rs, CollectionPersister persister, Object owner) throws HibernateException, SQLException
PersistentCollection
readFrom in class PersistentCollectionpublic void writeTo(PreparedStatement st, CollectionPersister persister, Object entry, int i, boolean writeOrder) throws HibernateException, SQLException
PersistentCollection
writeTo in class PersistentCollectionpublic void beforeInitialize(CollectionPersister persister)
PersistentCollection
beforeInitialize in class PersistentCollectionpublic boolean equalsSnapshot(Type elementType) throws HibernateException
PersistentCollection
equalsSnapshot in class PersistentCollectionprotected Serializable snapshot(CollectionPersister persister) throws HibernateException
PersistentCollection
snapshot in class PersistentCollectionpublic Collection getOrphans(Serializable snapshot) throws HibernateException
PersistentCollection
getOrphans in class PersistentCollectionHibernateExceptionpublic Serializable disassemble(CollectionPersister persister) throws HibernateException
PersistentCollection
disassemble in class PersistentCollectionpublic void initializeFromCache(CollectionPersister persister, Serializable disassembled, Object owner) throws HibernateException
PersistentCollection
initializeFromCache in class PersistentCollectionHibernateExceptionpublic boolean needsRecreate(CollectionPersister persister)
PersistentCollection
needsRecreate in class PersistentCollectionpublic Iterator getDeletes(Type elemType) throws HibernateException
PersistentCollection
getDeletes in class PersistentCollectionHibernateExceptionpublic boolean needsInserting(Object entry, int i, Type elemType) throws HibernateException
PersistentCollection
needsInserting in class PersistentCollectionHibernateExceptionpublic boolean needsUpdating(Object entry, int i, Type elemType)
PersistentCollection
needsUpdating in class PersistentCollectionpublic int size()
size in interface CollectionCollection.size()public boolean isEmpty()
isEmpty in interface CollectionCollection.isEmpty()public boolean contains(Object o)
contains in interface CollectionCollection.contains(Object)public Iterator iterator()
iterator in interface CollectionCollection.iterator()public Object[] toArray()
toArray in interface CollectionCollection.toArray()public Object[] toArray(Object[] a)
toArray in interface CollectionCollection.toArray(Object[])public boolean add(Object o)
add in interface CollectionCollection.add(Object)public boolean remove(Object o)
remove in interface CollectionCollection.remove(Object)public boolean containsAll(Collection c)
containsAll in interface CollectionCollection.containsAll(Collection)public boolean addAll(Collection c)
addAll in interface CollectionCollection.addAll(Collection)public void delayedAddAll(Collection c)
PersistentCollection
delayedAddAll in class PersistentCollectionpublic boolean removeAll(Collection c)
removeAll in interface CollectionCollection.removeAll(Collection)public boolean retainAll(Collection c)
retainAll in interface CollectionCollection.retainAll(Collection)public void clear()
clear in interface CollectionCollection.clear()public Object getIndex(Object entry, int i)
PersistentCollection
getIndex in class PersistentCollectionpublic org.odmg.DBag difference(org.odmg.DBag otherBag)
difference in interface org.odmg.DBagpublic org.odmg.DBag intersection(org.odmg.DBag otherBag)
intersection in interface org.odmg.DBagpublic int occurrences(Object o)
occurrences in interface org.odmg.DBagpublic 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 ListList.lastIndexOf(Object)public ListIterator listIterator()
listIterator in interface ListList.listIterator()public ListIterator listIterator(int i)
listIterator in interface ListList.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 PersistentCollectionpublic boolean equals(Object obj)
equals in interface CollectionObject.equals(java.lang.Object)public int hashCode()
hashCode in interface CollectionObject.hashCode()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||