KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > versant > core > common > VersantFieldMetaData


1
2 /*
3  * Copyright (c) 1998 - 2005 Versant Corporation
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  * Versant Corporation - initial API and implementation
11  */

12 package com.versant.core.common;
13
14 import com.versant.core.metadata.FieldMetaData;
15
16 import java.util.Comparator JavaDoc;
17
18 /**
19  * Meta data for a persistent or transactional field.
20  */

21 public interface VersantFieldMetaData {
22
23     /**
24      * Return the fully qualified name of this field.
25      */

26     public String JavaDoc getQName();
27
28     /**
29      * The name of the field.
30      */

31     public String JavaDoc getName();
32
33     /**
34      * The absolute fieldNo for this field.
35      */

36     public int getManagedFieldNo();
37
38     /**
39      * Is this an ordered collection?
40      */

41     public boolean isOrdered();
42
43     /**
44      * Is the element type (or value for maps) a persistent class?
45      */

46     public boolean isElementTypePC();
47
48     /**
49      * Is this a map with a persistent class key?
50      */

51     public boolean isKeyTypePC();
52
53     /**
54      * The type stored in the collection or the value type for a map or the
55      * component type for an array.
56      */

57     public Class JavaDoc getElementType();
58
59     /**
60      * The key type (null if not a map).
61      */

62     public Class JavaDoc getKeyType();
63
64     /**
65      * The type code for elementType (0 if none).
66      *
67      * @see com.versant.core.metadata.MDStatics
68      * @see #getElementType()
69      */

70     public int getElementTypeCode();
71
72     /**
73      * The type code for keyType (0 if none).
74      *
75      * @see com.versant.core.metadata.MDStatics
76      * @see #getKeyType()
77      */

78     public int getKeyTypeCode();
79
80     /**
81      * Is isMaster or isManyToMany is set then this indicates if
82      * the relationship is managed by the SCOs or not.
83      */

84     public boolean isManaged();
85
86     /**
87      * Is this field a master (one) in a master/detail (one-to-many)
88      * relationship
89      */

90     public boolean isMaster();
91
92     /**
93      * Is this field in a many-to-many relationship?
94      */

95     public boolean isManyToMany();
96
97     /**
98      * If isMaster, isDetail or isManyToMany is set then this is the fieldNo of
99      * the field on the other side of the relationship.
100      */

101     public int getInverseFieldNo();
102
103     /**
104      * If isMaster, isDetail or isManyToMany is set then this is the field
105      * on the other side of the relationship.
106      */

107     public VersantFieldMetaData getInverseFieldMetaData();
108
109     /**
110      * Get the comparator for this field if it makes sense i.e. this
111      * is a sorted Collection or Map with Comparator. This is cached.
112      */

113     public Comparator JavaDoc getComparator();
114
115     /**
116      * If this is a collection, array or map and this field is true then all
117      * data must be provided in the diff instance instead of just the changes
118      * on commit or flush. This is used for datastores like VDS that always
119      * write everything.
120      */

121     boolean isIncludeAllDataInDiff();
122
123     /**
124      * Is this an artificial field created to hold some store specific
125      * information (e.g. row version column values for a JDBC store)?
126      */

127     boolean isFake();
128 }
129
Popular Tags