Save This Page
Home » Hibernate-3.3.2.GA » org.hibernate » collection » [javadoc | source]
org.hibernate.collection
public class: PersistentBag [javadoc | source]
java.lang.Object
   org.hibernate.collection.AbstractPersistentCollection
      org.hibernate.collection.PersistentBag

All Implemented Interfaces:
    java$util$List, PersistentCollection, Serializable

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.
Nested Class Summary:
final class  PersistentBag.Clear   
final class  PersistentBag.SimpleAdd   
Field Summary
protected  List bag     
Fields inherited from org.hibernate.collection.AbstractPersistentCollection:
UNKNOWN
Constructor:
 public PersistentBag() 
 public PersistentBag(SessionImplementor session) 
 public PersistentBag(SessionImplementor session,
    Collection coll) 
Method from org.hibernate.collection.PersistentBag Summary:
add,   add,   addAll,   addAll,   beforeInitialize,   clear,   contains,   containsAll,   disassemble,   empty,   entries,   entryExists,   equals,   equalsSnapshot,   get,   getDeletes,   getElement,   getIndex,   getOrphans,   getSnapshot,   getSnapshotElement,   hashCode,   indexOf,   initializeFromCache,   isEmpty,   isRowUpdatePossible,   isSnapshotEmpty,   isWrapper,   iterator,   lastIndexOf,   listIterator,   listIterator,   needsInserting,   needsRecreate,   needsUpdating,   occurrences,   readFrom,   remove,   remove,   removeAll,   retainAll,   set,   size,   subList,   toArray,   toArray,   toString
Methods from org.hibernate.collection.AbstractPersistentCollection:
afterInitialize,   afterRowInsert,   beginRead,   clearDirty,   dirty,   empty,   endRead,   forceInitialization,   getCachedSize,   getIdentifier,   getKey,   getOrphans,   getOrphans,   getOwner,   getQueuedOrphans,   getRole,   getSession,   getSnapshot,   getStoredSnapshot,   getValue,   hasQueuedOperations,   identityRemove,   initialize,   isClearQueueEnabled,   isDirectlyAccessible,   isDirty,   isOperationQueueEnabled,   isPutQueueEnabled,   isRowUpdatePossible,   isUnreferenced,   needsRecreate,   performQueuedOperations,   postAction,   preInsert,   queueOperation,   queuedAdditionIterator,   read,   readElementByIndex,   readElementExistence,   readIndexExistence,   readSize,   setCurrentSession,   setDirectlyAccessible,   setInitialized,   setOwner,   setSnapshot,   unsetSession,   wasInitialized,   write
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.hibernate.collection.PersistentBag Detail:
 public boolean add(Object object) 
 public  void add(int i,
    Object o) 
 public boolean addAll(Collection values) 
 public boolean addAll(int i,
    Collection c) 
 public  void beforeInitialize(CollectionPersister persister,
    int anticipatedSize) 
 public  void clear() 
 public boolean contains(Object object) 
 public boolean containsAll(Collection c) 
 public Serializable disassemble(CollectionPersister persister) throws HibernateException 
 public boolean empty() 
 public Iterator entries(CollectionPersister persister) 
 public boolean entryExists(Object entry,
    int i) 
 public boolean equals(Object obj) 
    Bag does not respect the collection API and do an JVM instance comparison to do the equals. The semantic is broken not to have to initialize a collection for a simple equals() operation.
 public boolean equalsSnapshot(CollectionPersister persister) throws HibernateException 
 public Object get(int i) 
 public Iterator getDeletes(CollectionPersister persister,
    boolean indexIsFormula) throws HibernateException 
 public Object getElement(Object entry) 
 public Object getIndex(Object entry,
    int i,
    CollectionPersister persister) 
 public Collection getOrphans(Serializable snapshot,
    String entityName) throws HibernateException 
 public Serializable getSnapshot(CollectionPersister persister) throws HibernateException 
 public Object getSnapshotElement(Object entry,
    int i) 
 public int hashCode() 
 public int indexOf(Object o) 
 public  void initializeFromCache(CollectionPersister persister,
    Serializable disassembled,
    Object owner) throws HibernateException 
 public boolean isEmpty() 
 public boolean isRowUpdatePossible() 
 public boolean isSnapshotEmpty(Serializable snapshot) 
 public boolean isWrapper(Object collection) 
 public Iterator iterator() 
 public int lastIndexOf(Object o) 
 public ListIterator listIterator() 
 public ListIterator listIterator(int i) 
 public boolean needsInserting(Object entry,
    int i,
    Type elemType) throws HibernateException 
 public boolean needsRecreate(CollectionPersister persister) 
 public boolean needsUpdating(Object entry,
    int i,
    Type elemType) 
 public int occurrences(Object o) 
 public Object readFrom(ResultSet rs,
    CollectionPersister persister,
    CollectionAliases descriptor,
    Object owner) throws HibernateException, SQLException 
 public boolean remove(Object o) 
 public Object remove(int i) 
 public boolean removeAll(Collection c) 
 public boolean retainAll(Collection c) 
 public Object set(int i,
    Object o) 
 public int size() 
 public List subList(int start,
    int end) 
 public Object[] toArray() 
 public Object[] toArray(Object[] a) 
 public String toString()