KickJava   Java API By Example, From Geeks To Geeks.

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


1 //$Id: List.java,v 1.9 2005/02/20 03:34:49 oneovthafew Exp $
2
package org.hibernate.mapping;
3
4 import org.hibernate.MappingException;
5 import org.hibernate.type.CollectionType;
6 import org.hibernate.type.TypeFactory;
7
8 /**
9  * A list mapping has a primary key consisting of
10  * the key columns + index column.
11  * @author Gavin King
12  */

13 public class List extends IndexedCollection {
14     
15     private int baseIndex;
16
17     public boolean isList() {
18         return true;
19     }
20
21     public List(PersistentClass owner) {
22         super(owner);
23     }
24
25     public CollectionType getDefaultCollectionType() throws MappingException {
26         return TypeFactory.list( getRole(), getReferencedPropertyName(), isEmbedded() );
27     }
28     
29     public Object JavaDoc accept(ValueVisitor visitor) {
30         return visitor.accept(this);
31     }
32
33     public int getBaseIndex() {
34         return baseIndex;
35     }
36     
37     public void setBaseIndex(int baseIndex) {
38         this.baseIndex = baseIndex;
39     }
40 }
41
Popular Tags