01: //$Id: Bag.java 5793 2005-02-20 03:34:50Z oneovthafew $
02: package org.hibernate.mapping;
03:
04: import org.hibernate.type.CollectionType;
05: import org.hibernate.type.TypeFactory;
06:
07: /**
08: * A bag permits duplicates, so it has no primary key
09: * @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(),
19: isEmbedded());
20: }
21:
22: void createPrimaryKey() {
23: //create an index on the key columns??
24: }
25:
26: public Object accept(ValueVisitor visitor) {
27: return visitor.accept(this);
28: }
29: }
|