public class

PersistentIdentifierBag

extends AbstractPersistentCollection
implements List<E>
java.lang.Object
   ↳ org.hibernate.collection.AbstractPersistentCollection
     ↳ org.hibernate.collection.PersistentIdentifierBag

Class Overview

An IdentifierBag implements "bag" semantics more efficiently than a regular Bag by adding a synthetic identifier column to the table. This identifier is unique for all rows in the table, allowing very efficient updates and deletes. The value of the identifier is never exposed to the application.

IdentifierBags may not be used for a many-to-one association. Furthermore, there is no reason to use inverse="true".

Summary

Fields
protected Map identifiers
protected List values
[Expand]
Inherited Fields
From class org.hibernate.collection.AbstractPersistentCollection
Public Constructors
PersistentIdentifierBag(SessionImplementor session)
PersistentIdentifierBag()
PersistentIdentifierBag(SessionImplementor session, Collection coll)
Public Methods
boolean add(Object o)
void add(int index, Object element)
boolean addAll(Collection c)
boolean addAll(int index, Collection c)
void afterRowInsert(CollectionPersister persister, Object entry, int i)
Called after inserting a row, to fetch the natively generated id
void beforeInitialize(CollectionPersister persister, int anticipatedSize)
void clear()
boolean contains(Object o)
boolean containsAll(Collection c)
Serializable disassemble(CollectionPersister persister)
boolean empty()
Is the initialized collection empty?
Iterator entries(CollectionPersister persister)
boolean entryExists(Object entry, int i)
boolean equalsSnapshot(CollectionPersister persister)
Object get(int index)
Iterator getDeletes(CollectionPersister persister, boolean indexIsFormula)
Object getElement(Object entry)
Object getIdentifier(Object entry, int i)
Get the index of the given collection entry
Object getIndex(Object entry, int i, CollectionPersister persister)
Collection getOrphans(Serializable snapshot, String entityName)
get all "orphaned" elements
Serializable getSnapshot(CollectionPersister persister)
Object getSnapshotElement(Object entry, int i)
int indexOf(Object o)
void initializeFromCache(CollectionPersister persister, Serializable disassembled, Object owner)
boolean isEmpty()
boolean isSnapshotEmpty(Serializable snapshot)
boolean isWrapper(Object collection)
Iterator iterator()
int lastIndexOf(Object o)
ListIterator listIterator(int index)
ListIterator listIterator()
boolean needsInserting(Object entry, int i, Type elemType)
boolean needsUpdating(Object entry, int i, Type elemType)
void preInsert(CollectionPersister persister)
Called before inserting rows, to ensure that any surrogate keys are fully generated
Object readFrom(ResultSet rs, CollectionPersister persister, CollectionAliases descriptor, Object owner)
Object remove(int index)
boolean remove(Object o)
boolean removeAll(Collection c)
boolean retainAll(Collection c)
Object set(int index, Object element)
int size()
List subList(int fromIndex, int toIndex)
Object[] toArray(Object[] a)
Object[] toArray()
[Expand]
Inherited Methods
From class org.hibernate.collection.AbstractPersistentCollection
From class java.lang.Object
From interface java.lang.Iterable
From interface java.util.Collection
From interface java.util.List
From interface org.hibernate.collection.PersistentCollection

Fields

protected Map identifiers

protected List values

Public Constructors

public PersistentIdentifierBag (SessionImplementor session)

public PersistentIdentifierBag ()

public PersistentIdentifierBag (SessionImplementor session, Collection coll)

Public Methods

public boolean add (Object o)

public void add (int index, Object element)

public boolean addAll (Collection c)

public boolean addAll (int index, Collection c)

public void afterRowInsert (CollectionPersister persister, Object entry, int i)

Called after inserting a row, to fetch the natively generated id

public void beforeInitialize (CollectionPersister persister, int anticipatedSize)

public void clear ()

public boolean contains (Object o)

public boolean containsAll (Collection c)

public Serializable disassemble (CollectionPersister persister)

public boolean empty ()

Is the initialized collection empty?

public Iterator entries (CollectionPersister persister)

public boolean entryExists (Object entry, int i)

public boolean equalsSnapshot (CollectionPersister persister)

public Object get (int index)

public Iterator getDeletes (CollectionPersister persister, boolean indexIsFormula)

public Object getElement (Object entry)

public Object getIdentifier (Object entry, int i)

Get the index of the given collection entry

public Object getIndex (Object entry, int i, CollectionPersister persister)

public Collection getOrphans (Serializable snapshot, String entityName)

get all "orphaned" elements

public Serializable getSnapshot (CollectionPersister persister)

public Object getSnapshotElement (Object entry, int i)

public int indexOf (Object o)

public void initializeFromCache (CollectionPersister persister, Serializable disassembled, Object owner)

public boolean isEmpty ()

public boolean isSnapshotEmpty (Serializable snapshot)

public boolean isWrapper (Object collection)

public Iterator iterator ()

public int lastIndexOf (Object o)

public ListIterator listIterator (int index)

public ListIterator listIterator ()

public boolean needsInserting (Object entry, int i, Type elemType)

public boolean needsUpdating (Object entry, int i, Type elemType)

public void preInsert (CollectionPersister persister)

Called before inserting rows, to ensure that any surrogate keys are fully generated

public Object readFrom (ResultSet rs, CollectionPersister persister, CollectionAliases descriptor, Object owner)

public Object remove (int index)

public boolean remove (Object o)

public boolean removeAll (Collection c)

public boolean retainAll (Collection c)

public Object set (int index, Object element)

public int size ()

public List subList (int fromIndex, int toIndex)

public Object[] toArray (Object[] a)

public Object[] toArray ()