|
|||||||||||
| 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)
add in interface Listpublic void clear()
clear in interface Listpublic boolean contains(Object o)
contains in interface Listpublic boolean containsAll(Collection c)
containsAll in interface Listpublic boolean isEmpty()
isEmpty in interface Listpublic Iterator iterator()
iterator in interface Listpublic boolean remove(Object o)
remove in interface Listpublic boolean removeAll(Collection c)
removeAll in interface Listpublic boolean retainAll(Collection c)
retainAll in interface Listpublic int size()
size in interface Listpublic Object[] toArray()
toArray in interface Listpublic Object[] toArray(Object[] a)
toArray in interface Listpublic void beforeInitialize(CollectionPersister persister)
PersistentCollection
beforeInitialize in class PersistentCollection
public Serializable disassemble(CollectionPersister persister)
throws HibernateException
PersistentCollection
disassemble in class PersistentCollectionHibernateExceptionpublic boolean empty()
PersistentCollection
empty in class PersistentCollectionpublic 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 PersistentCollectionHibernateException
public Iterator getDeletes(Type elemType)
throws HibernateException
PersistentCollection
getDeletes in class PersistentCollectionHibernateException
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 PersistentCollectionHibernateException
public boolean needsUpdating(Object entry,
int i,
Type elemType)
throws HibernateException
PersistentCollection
needsUpdating in class PersistentCollectionHibernateException
public Object readFrom(ResultSet rs,
CollectionPersister persister,
Object owner)
throws HibernateException,
SQLException
PersistentCollection
readFrom in class PersistentCollectionHibernateException
SQLException
protected Serializable snapshot(CollectionPersister persister)
throws HibernateException
PersistentCollection
snapshot in class PersistentCollectionHibernateException
public Collection getOrphans(Serializable snapshot)
throws HibernateException
PersistentCollection
getOrphans in class PersistentCollectionHibernateException
public void preInsert(CollectionPersister persister)
throws HibernateException
PersistentCollection
preInsert in class PersistentCollectionHibernateException
public 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)
add in interface List
public boolean addAll(int index,
Collection c)
addAll in interface Listpublic Object get(int index)
get in interface Listpublic int indexOf(Object o)
indexOf in interface Listpublic 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)
remove in interface List
public Object set(int index,
Object element)
set in interface List
public List subList(int fromIndex,
int toIndex)
subList in interface Listpublic boolean addAll(Collection c)
addAll in interface List
public void afterRowInsert(CollectionPersister persister,
Object entry,
int i)
throws HibernateException
PersistentCollection
afterRowInsert in class PersistentCollectionHibernateException
protected JDBCException convert(SQLException sqlException,
String message)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||