FileDocCategorySizeDatePackage
ListType.javaAPI DocHibernate 3.2.51728Wed Jul 05 13:17:28 BST 2006org.hibernate.type

ListType

public class ListType extends CollectionType

Fields Summary
Constructors Summary
public ListType(String role, String propertyRef, boolean isEmbeddedInXML)

		super(role, propertyRef, isEmbeddedInXML);
	
Methods Summary
public java.lang.ClassgetReturnedClass()

		return List.class;
	
public java.lang.ObjectindexOf(java.lang.Object collection, java.lang.Object element)

		List list = (List) collection;
		for ( int i=0; i<list.size(); i++ ) {
			//TODO: proxies!
			if ( list.get(i)==element ) return new Integer(i);
		}
		return null;
	
public org.hibernate.collection.PersistentCollectioninstantiate(org.hibernate.engine.SessionImplementor session, org.hibernate.persister.collection.CollectionPersister persister, java.io.Serializable key)

		if ( session.getEntityMode()==EntityMode.DOM4J ) {
			return new PersistentListElementHolder(session, persister, key);
		}
		else {
			return new PersistentList(session);
		}
	
public java.lang.Objectinstantiate(int anticipatedSize)

		return anticipatedSize <= 0 ? new ArrayList() : new ArrayList( anticipatedSize + 1 );
	
public org.hibernate.collection.PersistentCollectionwrap(org.hibernate.engine.SessionImplementor session, java.lang.Object collection)

		if ( session.getEntityMode()==EntityMode.DOM4J ) {
			return new PersistentListElementHolder( session, (Element) collection );
		}
		else {
			return new PersistentList( session, (List) collection );
		}