KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > type > IdentifierBagType


1 //$Id: IdentifierBagType.java,v 1.9 2005/02/20 03:34:49 oneovthafew Exp $
2
package org.hibernate.type;
3
4 import java.io.Serializable JavaDoc;
5 import java.util.ArrayList JavaDoc;
6
7 import org.hibernate.HibernateException;
8 import org.hibernate.collection.PersistentIdentifierBag;
9 import org.hibernate.collection.PersistentCollection;
10 import org.hibernate.engine.SessionImplementor;
11 import org.hibernate.persister.collection.CollectionPersister;
12
13 public class IdentifierBagType extends CollectionType {
14
15     public IdentifierBagType(String JavaDoc role, String JavaDoc propertyRef, boolean isEmbeddedInXML) {
16         super(role, propertyRef, isEmbeddedInXML);
17     }
18
19     public PersistentCollection instantiate(
20         SessionImplementor session,
21         CollectionPersister persister, Serializable JavaDoc key)
22         throws HibernateException {
23
24         return new PersistentIdentifierBag(session);
25     }
26
27     public Object JavaDoc instantiate(Object JavaDoc original) {
28         return new ArrayList JavaDoc();
29     }
30     
31     public Class JavaDoc getReturnedClass() {
32         return java.util.Collection JavaDoc.class;
33     }
34
35     public PersistentCollection wrap(SessionImplementor session, Object JavaDoc collection) {
36         return new PersistentIdentifierBag( session, (java.util.Collection JavaDoc) collection );
37     }
38
39 }
40
41
42
43
44
45
46
Popular Tags