|
|||||||||||
| 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.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 PersistentCollectionHibernateExceptionpublic boolean isWrapper(Object collection)
PersistentCollection
isWrapper in class PersistentCollectionpublic boolean add(Object o)
public void clear()
public boolean contains(Object o)
public boolean containsAll(Collection c)
containsAll in interface Listpublic 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 PersistentCollectionpublic Serializable disassemble(CollectionPersister persister) throws HibernateException
PersistentCollection
disassemble in class PersistentCollectionHibernateExceptionpublic boolean empty()
PersistentCollection
empty in class PersistentCollectionpublic Iterator entries()
PersistentCollection
entries in class PersistentCollectionpublic boolean entryExists(Object entry, int i)
PersistentCollection
entryExists in class PersistentCollectionpublic boolean equalsSnapshot(Type elementType) throws HibernateException
PersistentCollection
equalsSnapshot in class PersistentCollectionHibernateExceptionpublic Iterator getDeletes(Type elemType) throws HibernateException
PersistentCollection
getDeletes in class PersistentCollectionHibernateExceptionpublic Object getIndex(Object entry, int i)
PersistentCollection
getIndex in class PersistentCollectionpublic boolean needsInserting(Object entry, int i, Type elemType) throws HibernateException
PersistentCollection
needsInserting in class PersistentCollectionHibernateExceptionpublic boolean needsUpdating(Object entry, int i, Type elemType) throws HibernateException
PersistentCollection
needsUpdating in class PersistentCollectionHibernateExceptionpublic Object readFrom(ResultSet rs, CollectionPersister persister, Object owner) throws HibernateException, SQLException
PersistentCollection
readFrom in class PersistentCollectionHibernateException
SQLExceptionprotected Serializable snapshot(CollectionPersister persister) throws HibernateException
PersistentCollection
snapshot in class PersistentCollectionHibernateExceptionpublic Collection getOrphans(Serializable snapshot) throws HibernateException
PersistentCollection
getOrphans in class PersistentCollectionHibernateExceptionpublic void preInsert(CollectionPersister persister) throws HibernateException
PersistentCollection
preInsert in class PersistentCollectionHibernateExceptionpublic void writeTo(PreparedStatement st, CollectionPersister persister, Object entry, int i, boolean writeOrder) throws HibernateException, SQLException
PersistentCollection
writeTo in class PersistentCollectionHibernateException
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 Listpublic ListIterator listIterator()
listIterator in interface Listpublic ListIterator listIterator(int index)
listIterator in interface Listpublic 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 PersistentCollectionHibernateExceptionprotected JDBCException convert(SQLException sqlException, String message)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||