PersistentListElementHolderpublic class PersistentListElementHolder extends PersistentIndexedElementHolder
Methods Summary |
---|
public java.io.Serializable | disassemble(org.hibernate.persister.collection.CollectionPersister persister)
Type elementType = persister.getElementType();
final String indexNodeName = getIndexAttributeName(persister);
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() );
Integer index = (Integer) Hibernate.INTEGER.fromStringValue( getIndex(elem, indexNodeName, i) );
result[ index.intValue() ] = elementType.disassemble( object, getSession(), null );
}
return result;
| public void | initializeFromCache(org.hibernate.persister.collection.CollectionPersister persister, java.io.Serializable disassembled, java.lang.Object owner)
Type elementType = persister.getElementType();
final String indexNodeName = getIndexAttributeName(persister);
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() );
setIndex( subelement, indexNodeName, Integer.toString(i) );
}
|
|