org.hibernate.test.usercollection.basic
Class MyListType

java.lang.Object
  extended by org.hibernate.test.usercollection.basic.MyListType
All Implemented Interfaces:
UserCollectionType

public class MyListType
extends Object
implements UserCollectionType


Constructor Summary
MyListType()
           
 
Method Summary
 boolean contains(Object collection, Object entity)
          Optional operation.
 Iterator getElementsIterator(Object collection)
          Return an iterator over the elements of this collection - the passed collection instance may or may not be a wrapper
 Object indexOf(Object collection, Object entity)
          Optional operation.
 Object instantiate(int anticipatedSize)
          Instantiate an empty instance of the "underlying" collection (not a wrapper), but with the given anticipated size (i.e.
 PersistentCollection instantiate(SessionImplementor session, CollectionPersister persister)
          Instantiate an uninitialized instance of the collection wrapper
 Object replaceElements(Object original, Object target, CollectionPersister persister, Object owner, Map copyCache, SessionImplementor session)
          Replace the elements of a collection with the elements of another collection
 PersistentCollection wrap(SessionImplementor session, Object collection)
          Wrap an instance of a collection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MyListType

public MyListType()
Method Detail

instantiate

public PersistentCollection instantiate(SessionImplementor session,
                                        CollectionPersister persister)
                                 throws HibernateException
Description copied from interface: UserCollectionType
Instantiate an uninitialized instance of the collection wrapper

Specified by:
instantiate in interface UserCollectionType
Throws:
HibernateException

wrap

public PersistentCollection wrap(SessionImplementor session,
                                 Object collection)
Description copied from interface: UserCollectionType
Wrap an instance of a collection

Specified by:
wrap in interface UserCollectionType

getElementsIterator

public Iterator getElementsIterator(Object collection)
Description copied from interface: UserCollectionType
Return an iterator over the elements of this collection - the passed collection instance may or may not be a wrapper

Specified by:
getElementsIterator in interface UserCollectionType

contains

public boolean contains(Object collection,
                        Object entity)
Description copied from interface: UserCollectionType
Optional operation. Does the collection contain the entity instance?

Specified by:
contains in interface UserCollectionType

indexOf

public Object indexOf(Object collection,
                      Object entity)
Description copied from interface: UserCollectionType
Optional operation. Return the index of the entity in the collection.

Specified by:
indexOf in interface UserCollectionType

replaceElements

public Object replaceElements(Object original,
                              Object target,
                              CollectionPersister persister,
                              Object owner,
                              Map copyCache,
                              SessionImplementor session)
                       throws HibernateException
Description copied from interface: UserCollectionType
Replace the elements of a collection with the elements of another collection

Specified by:
replaceElements in interface UserCollectionType
Throws:
HibernateException

instantiate

public Object instantiate(int anticipatedSize)
Description copied from interface: UserCollectionType
Instantiate an empty instance of the "underlying" collection (not a wrapper), but with the given anticipated size (i.e. accounting for initial size and perhaps load factor).

Specified by:
instantiate in interface UserCollectionType
Parameters:
anticipatedSize - The anticipated size of the instaniated collection after we are done populating it. Note, may be negative to indicate that we not yet know anything about the anticipated size (i.e., when initializing from a result set row by row).


Copyright © 2001-2012 Red Hat, Inc. All Rights Reserved.