From: <one...@us...> - 2003-05-02 09:17:28
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/type In directory sc8-pr-cvs1:/tmp/cvs-serv19050 Modified Files: TypeFactory.java Added Files: IdentifierBagType.java Log Message: added idbag and made some cleanups to collection fwk --- NEW FILE: IdentifierBagType.java --- //$Id: IdentifierBagType.java,v 1.1 2003/05/02 09:17:13 oneovthafew Exp $ package net.sf.hibernate.type; import java.io.Serializable; import net.sf.hibernate.HibernateException; import net.sf.hibernate.collection.CollectionPersister; import net.sf.hibernate.collection.IdentifierBag; import net.sf.hibernate.collection.PersistentCollection; import net.sf.hibernate.engine.SessionImplementor; public class IdentifierBagType extends PersistentCollectionType { public IdentifierBagType(String role) { super(role); } protected PersistentCollection instantiate( SessionImplementor session, CollectionPersister persister) throws HibernateException { return new IdentifierBag(session); } public Class getReturnedClass() { return java.util.Collection.class; } public PersistentCollection wrap(SessionImplementor session, Object collection) { return new IdentifierBag( session, (java.util.Collection) collection ); } public PersistentCollection assembleCachedCollection( SessionImplementor session, CollectionPersister persister, Serializable disassembled, Object owner) throws HibernateException { return new IdentifierBag(session, persister, disassembled, owner); } } Index: TypeFactory.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/type/TypeFactory.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TypeFactory.java 25 Apr 2003 03:40:37 -0000 1.8 --- TypeFactory.java 2 May 2003 09:17:14 -0000 1.9 *************** *** 173,176 **** --- 173,179 ---- return new BagType(role); } + public static PersistentCollectionType idbag(String role) { + return new IdentifierBagType(role); + } public static PersistentCollectionType map(String role) { return new MapType(role); |