Methods Summary |
---|
public void | beforeInitialize(org.hibernate.persister.collection.CollectionPersister persister, int anticipatedSize)
|
public java.io.Serializable | disassemble(org.hibernate.persister.collection.CollectionPersister persister)
Type elementType = persister.getElementType();
List elements = element.elements( persister.getElementNodeName() );
int length = elements.size();
Serializable[] result = new Serializable[length];
for ( int i=0; i<length; i++ ) {
Element elem = (Element) elements.get(i);
Object object = elementType.fromXMLNode( elem, persister.getFactory() );
result[i] = elementType.disassemble( object, getSession(), null );
}
return result;
|
public boolean | empty()
return !element.elementIterator().hasNext();
|
public java.util.Iterator | entries(org.hibernate.persister.collection.CollectionPersister persister)
final Type elementType = persister.getElementType();
List elements = element.elements( persister.getElementNodeName() );
int length = elements.size();
List result = new ArrayList(length);
for ( int i=0; i<length; i++ ) {
Element elem = (Element) elements.get(i);
Object object = elementType.fromXMLNode( elem, persister.getFactory() );
result.add(object);
}
return result.iterator();
|
public boolean | entryExists(java.lang.Object entry, int i)
return entry!=null;
|
public boolean | equalsSnapshot(org.hibernate.persister.collection.CollectionPersister persister)
Type elementType = persister.getElementType();
ArrayList snapshot = (ArrayList) getSnapshot();
List elements = element.elements( persister.getElementNodeName() );
if ( snapshot.size()!= elements.size() ) return false;
for ( int i=0; i<snapshot.size(); i++ ) {
Object old = snapshot.get(i);
Element elem = (Element) elements.get(i);
Object current = elementType.fromXMLNode( elem, persister.getFactory() );
if ( elementType.isDirty( old, current, getSession() ) ) return false;
}
return true;
|
public java.util.Iterator | getDeletes(org.hibernate.persister.collection.CollectionPersister persister, boolean indexIsFormula)
Type elementType = persister.getElementType();
ArrayList snapshot = (ArrayList) getSnapshot();
List elements = element.elements( persister.getElementNodeName() );
ArrayList result = new ArrayList();
for ( int i=0; i<snapshot.size(); i++ ) {
Object old = snapshot.get(i);
if ( i >= elements.size() ) {
result.add(old);
}
else {
Element elem = (Element) elements.get(i);
Object object = elementType.fromXMLNode( elem, persister.getFactory() );
if ( elementType.isDirty( old, object, getSession() ) ) result.add(old);
}
}
return result.iterator();
|
public java.lang.Object | getElement(java.lang.Object entry)
return entry;
|
public java.lang.Object | getIndex(java.lang.Object entry, int i, org.hibernate.persister.collection.CollectionPersister persister)
throw new UnsupportedOperationException();
|
public java.util.Collection | getOrphans(java.io.Serializable snapshot, java.lang.String entityName)
//orphan delete not supported for EntityMode.DOM4J
return CollectionHelper.EMPTY_COLLECTION;
|
public java.io.Serializable | getSnapshot(org.hibernate.persister.collection.CollectionPersister persister)
final Type elementType = persister.getElementType();
List elements = element.elements( persister.getElementNodeName() );
ArrayList snapshot = new ArrayList( elements.size() );
for ( int i=0; i<elements.size(); i++ ) {
Element elem = (Element) elements.get(i);
Object value = elementType.fromXMLNode( elem, persister.getFactory() );
Object copy = elementType.deepCopy(value , getSession().getEntityMode(), persister.getFactory() );
snapshot.add(copy);
}
return snapshot;
|
public java.lang.Object | getSnapshotElement(java.lang.Object entry, int i)
throw new UnsupportedOperationException();
|
public java.lang.Object | getValue()
return element;
|
public void | initializeFromCache(org.hibernate.persister.collection.CollectionPersister persister, java.io.Serializable disassembled, java.lang.Object owner)
Type elementType = persister.getElementType();
Serializable[] cached = (Serializable[]) disassembled;
for ( int i=0; i<cached.length; i++ ) {
Object object = elementType.assemble( cached[i], getSession(), owner );
Element subelement = element.addElement( persister.getElementNodeName() );
elementType.setToXMLNode( subelement, object, persister.getFactory() );
}
|
public boolean | isDirectlyAccessible()
return true;
|
public boolean | isSnapshotEmpty(java.io.Serializable snapshot)
return ( (Collection) snapshot ).isEmpty();
|
public boolean | isWrapper(java.lang.Object collection)
return element==collection;
|
public boolean | needsInserting(java.lang.Object entry, int i, org.hibernate.type.Type elementType)
ArrayList snapshot = (ArrayList) getSnapshot();
return i>=snapshot.size() || elementType.isDirty( snapshot.get(i), entry, getSession() );
|
public boolean | needsUpdating(java.lang.Object entry, int i, org.hibernate.type.Type elementType)
return false;
|
public java.lang.Object | readFrom(java.sql.ResultSet rs, org.hibernate.persister.collection.CollectionPersister persister, org.hibernate.loader.CollectionAliases descriptor, java.lang.Object owner)
Object object = persister.readElement( rs, owner, descriptor.getSuffixedElementAliases(), getSession() );
final Type elementType = persister.getElementType();
Element subelement = element.addElement( persister.getElementNodeName() );
elementType.setToXMLNode( subelement, object, persister.getFactory() );
return object;
|