org.hibernate.collection.PersistentListElementHolder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hibernate-core Show documentation
Show all versions of hibernate-core Show documentation
The core functionality of Hibernate
//$Id: PersistentListElementHolder.java 6838 2005-05-20 19:50:07Z oneovthafew $
package org.hibernate.collection;
import java.io.Serializable;
import java.util.List;
import org.dom4j.Element;
import org.hibernate.Hibernate;
import org.hibernate.HibernateException;
import org.hibernate.engine.SessionImplementor;
import org.hibernate.persister.collection.CollectionPersister;
import org.hibernate.type.Type;
/**
* @author Gavin King
*/
public class PersistentListElementHolder extends PersistentIndexedElementHolder {
public PersistentListElementHolder(SessionImplementor session, Element element) {
super( session, element );
}
public PersistentListElementHolder(SessionImplementor session, CollectionPersister persister,
Serializable key) throws HibernateException {
super( session, persister, key );
}
public void initializeFromCache(CollectionPersister persister, Serializable disassembled, Object owner)
throws HibernateException {
Type elementType = persister.getElementType();
final String indexNodeName = getIndexAttributeName(persister);
Serializable[] cached = (Serializable[]) disassembled;
for ( int i=0; i