FileDocCategorySizeDatePackage
MyListType.javaAPI DocHibernate 3.2.51770Tue May 08 22:52:56 BST 2007org.hibernate.test.usercollection.basic

MyListType

public class MyListType extends Object implements org.hibernate.usertype.UserCollectionType

Fields Summary
static int
lastInstantiationRequest
Constructors Summary
Methods Summary
public booleancontains(java.lang.Object collection, java.lang.Object entity)

		return ( (IMyList) collection ).contains(entity);
	
public java.util.IteratorgetElementsIterator(java.lang.Object collection)

		return ( (IMyList) collection ).iterator();
	
public java.lang.ObjectindexOf(java.lang.Object collection, java.lang.Object entity)

		int l = ( (IMyList) collection ).indexOf(entity);
		if(l<0) {
			return null;
		} else {
			return new Integer(l);
		}
	
public org.hibernate.collection.PersistentCollectioninstantiate(org.hibernate.engine.SessionImplementor session, org.hibernate.persister.collection.CollectionPersister persister)


	        
		return new PersistentMyList(session);
	
public java.lang.Objectinstantiate(int anticipatedSize)

		lastInstantiationRequest = anticipatedSize;
		return new MyList();
	
public java.lang.ObjectreplaceElements(java.lang.Object original, java.lang.Object target, org.hibernate.persister.collection.CollectionPersister persister, java.lang.Object owner, java.util.Map copyCache, org.hibernate.engine.SessionImplementor session)

		IMyList result = (IMyList) target;
		result.clear();
		result.addAll((MyList)original);
		return result;
	
public org.hibernate.collection.PersistentCollectionwrap(org.hibernate.engine.SessionImplementor session, java.lang.Object collection)

		if ( session.getEntityMode()==EntityMode.DOM4J ) {
			throw new IllegalStateException("dom4j not supported");
		}
		else {
			return new PersistentMyList( session, (IMyList) collection );
		}