KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > mapping > Bag


1 //$Id: Bag.java,v 1.8 2005/02/20 03:34:49 oneovthafew Exp $
2
package org.hibernate.mapping;
3
4 import org.hibernate.type.CollectionType;
5 import org.hibernate.type.TypeFactory;
6
7 /**
8  * A bag permits duplicates, so it has no primary key
9  * @author Gavin King
10  */

11 public class Bag extends Collection {
12
13     public Bag(PersistentClass owner) {
14         super(owner);
15     }
16
17     public CollectionType getDefaultCollectionType() {
18         return TypeFactory.bag( getRole(), getReferencedPropertyName(), isEmbedded() );
19     }
20
21     void createPrimaryKey() {
22         //create an index on the key columns??
23
}
24
25     public Object JavaDoc accept(ValueVisitor visitor) {
26         return visitor.accept(this);
27     }
28 }
29
Popular Tags