|
|||||||||||
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.IdentifierBag
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".
Constructor Summary | |
IdentifierBag()
|
|
IdentifierBag(SessionImplementor session)
|
|
IdentifierBag(SessionImplementor session,
Collection coll)
|
Method Summary | |
void |
add(int index,
Object element)
|
boolean |
add(Object o)
|
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)
Called before any elements are read into the collection, allowing appropriate initializations to occur. |
void |
clear()
|
boolean |
contains(Object o)
|
boolean |
containsAll(Collection c)
|
protected JDBCException |
convert(SQLException sqlException,
String message)
|
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 |
equalsSnapshot(Type elementType)
Does the current state exactly match the snapshot? |
Object |
get(int index)
|
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 |
indexOf(Object o)
|
void |
initializeFromCache(CollectionPersister persister,
Serializable disassembled,
Object owner)
Read the state of the collection from a disassembled cached value |
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 index)
|
boolean |
needsInserting(Object entry,
int i,
Type elemType)
Do we need to insert this element? |
boolean |
needsUpdating(Object entry,
int i,
Type elemType)
Do we need to update this element? |
void |
preInsert(CollectionPersister persister)
Called before inserting rows, to ensure that any surrogate keys are fully generated |
Object |
readFrom(ResultSet rs,
CollectionPersister persister,
Object owner)
Read a row from the JDBC result set |
Object |
remove(int index)
|
boolean |
remove(Object o)
|
boolean |
removeAll(Collection c)
|
boolean |
retainAll(Collection c)
|
Object |
set(int index,
Object element)
|
int |
size()
|
protected Serializable |
snapshot(CollectionPersister persister)
Return a new snapshot of the current state |
List |
subList(int fromIndex,
int toIndex)
|
Object[] |
toArray()
|
Object[] |
toArray(Object[] a)
|
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 |
beginRead, delayedAddAll, endRead, forceInitialization, getCollectionSnapshot, getOrphans, getSession, getSnapshot, getSnapshot, getValue, hasQueuedAdditions, initialize, isDirectlyAccessible, needsRecreate, postFlush, queueAdd, queueAddAll, queuedAdditionIterator, read, setCollectionSnapshot, setCurrentSession, setDirectlyAccessible, setInitialized, unsetSession, wasInitialized, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.List |
equals, hashCode |
Constructor Detail |
public IdentifierBag(SessionImplementor session)
public IdentifierBag()
public IdentifierBag(SessionImplementor session, Collection coll)
Method Detail |
public void initializeFromCache(CollectionPersister persister, Serializable disassembled, Object owner) throws HibernateException
PersistentCollection
initializeFromCache
in class PersistentCollection
HibernateException
public boolean isWrapper(Object collection)
PersistentCollection
isWrapper
in class PersistentCollection
public boolean add(Object o)
public void clear()
public boolean contains(Object o)
public boolean containsAll(Collection c)
containsAll
in interface List
public boolean isEmpty()
public Iterator iterator()
public boolean remove(Object o)
public boolean removeAll(Collection c)
public boolean retainAll(Collection c)
public int size()
public Object[] toArray()
public Object[] toArray(Object[] a)
public void beforeInitialize(CollectionPersister persister)
PersistentCollection
beforeInitialize
in class PersistentCollection
public Serializable disassemble(CollectionPersister persister) throws HibernateException
PersistentCollection
disassemble
in class PersistentCollection
HibernateException
public boolean empty()
PersistentCollection
empty
in class PersistentCollection
public Iterator entries()
PersistentCollection
entries
in class PersistentCollection
public boolean entryExists(Object entry, int i)
PersistentCollection
entryExists
in class PersistentCollection
public boolean equalsSnapshot(Type elementType) throws HibernateException
PersistentCollection
equalsSnapshot
in class PersistentCollection
HibernateException
public Iterator getDeletes(Type elemType) throws HibernateException
PersistentCollection
getDeletes
in class PersistentCollection
HibernateException
public Object getIndex(Object entry, int i)
PersistentCollection
getIndex
in class PersistentCollection
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) throws HibernateException
PersistentCollection
needsUpdating
in class PersistentCollection
HibernateException
public Object readFrom(ResultSet rs, CollectionPersister persister, Object owner) throws HibernateException, SQLException
PersistentCollection
readFrom
in class PersistentCollection
HibernateException
SQLException
protected Serializable snapshot(CollectionPersister persister) throws HibernateException
PersistentCollection
snapshot
in class PersistentCollection
HibernateException
public Collection getOrphans(Serializable snapshot) throws HibernateException
PersistentCollection
getOrphans
in class PersistentCollection
HibernateException
public void preInsert(CollectionPersister persister) throws HibernateException
PersistentCollection
preInsert
in class PersistentCollection
HibernateException
public void writeTo(PreparedStatement st, CollectionPersister persister, Object entry, int i, boolean writeOrder) throws HibernateException, SQLException
PersistentCollection
writeTo
in class PersistentCollection
HibernateException
SQLException
public void add(int index, Object element)
public boolean addAll(int index, Collection c)
public Object get(int index)
public int indexOf(Object o)
public int lastIndexOf(Object o)
lastIndexOf
in interface List
public ListIterator listIterator()
listIterator
in interface List
public ListIterator listIterator(int index)
listIterator
in interface List
public Object remove(int index)
public Object set(int index, Object element)
public List subList(int fromIndex, int toIndex)
public boolean addAll(Collection c)
public void afterRowInsert(CollectionPersister persister, Object entry, int i) throws HibernateException
PersistentCollection
afterRowInsert
in class PersistentCollection
HibernateException
protected JDBCException convert(SQLException sqlException, String message)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |