001: /*
002: * Copyright (c) 1998 - 2005 Versant Corporation
003: * All rights reserved. This program and the accompanying materials
004: * are made available under the terms of the Eclipse Public License v1.0
005: * which accompanies this distribution, and is available at
006: * http://www.eclipse.org/legal/epl-v10.html
007: *
008: * Contributors:
009: * Versant Corporation - initial API and implementation
010: */
011: package com.versant.core.metadata;
012:
013: /**
014: * Constants used in the meta data.
015: */
016: public interface MDStatics {
017:
018: public static final int CASCADE_PERSIST = 1;
019: public static final int CASCADE_MERGE = 2;
020: public static final int CASCADE_REMOVE = 4;
021: public static final int CASCADE_REFRESH = 8;
022: public static final int CASCADE_ALL = CASCADE_PERSIST
023: + CASCADE_MERGE + CASCADE_REMOVE + CASCADE_REFRESH;
024:
025: /**
026: * Boolean value not set in a .jdo file.
027: */
028: public static final int NOT_SET = 0;
029: /**
030: * Boolean value set as false in a .jdo file.
031: */
032: public static final int FALSE = 1;
033: /**
034: * Boolean value set as true in a .jdo file.
035: */
036: public static final int TRUE = 2;
037:
038: public static final int IDENTITY_TYPE_APPLICATION = 1;
039: public static final int IDENTITY_TYPE_DATASTORE = 2;
040: public static final int IDENTITY_TYPE_NONDURABLE = 3;
041:
042: public static final int PERSISTENCE_MODIFIER_PERSISTENT = 1;
043: public static final int PERSISTENCE_MODIFIER_TRANSACTIONAL = 2;
044: public static final int PERSISTENCE_MODIFIER_NONE = 3;
045:
046: public static final int NULL_VALUE_EXCEPTION = 1;
047: public static final int NULL_VALUE_DEFAULT = 2;
048: public static final int NULL_VALUE_NONE = 3;
049:
050: /**
051: * A datastore identity primary key 'field' (used by workbench).
052: */
053: public static final int CATEGORY_DATASTORE_PK = 1;
054: /**
055: * A class-id 'field' (used by workbench).
056: */
057: public static final int CATEGORY_CLASS_ID = 2;
058: /**
059: * A version or timestamp 'field' (used by workbench).
060: */
061: public static final int CATEGORY_OPT_LOCKING = 3;
062:
063: /**
064: * A normal field (e.g. int, String etc).
065: */
066: public static final int CATEGORY_SIMPLE = 4;
067: /**
068: * A reference to a PC class.
069: */
070: public static final int CATEGORY_REF = 5;
071: /**
072: * A reference to any PC class.
073: */
074: public static final int CATEGORY_POLYREF = 6;
075: /**
076: * A Collection.
077: */
078: public static final int CATEGORY_COLLECTION = 7;
079: /**
080: * An array.
081: */
082: public static final int CATEGORY_ARRAY = 8;
083: /**
084: * A Map.
085: */
086: public static final int CATEGORY_MAP = 9;
087: /**
088: * A transactional non-persistent field.
089: */
090: public static final int CATEGORY_TRANSACTIONAL = 10;
091: /**
092: * A non-persistent field.
093: */
094: public static final int CATEGORY_NONE = 11;
095: /**
096: * An externalized field
097: */
098: public static final int CATEGORY_EXTERNALIZED = 12;
099:
100: public static final int AUTOSET_NO = 0;
101: public static final int AUTOSET_CREATED = 1;
102: public static final int AUTOSET_MODIFIED = 2;
103: public static final int AUTOSET_BOTH = 3;
104:
105: /**
106: * Do not cache instances of this class.
107: */
108: public static final int CACHE_STRATEGY_NO = 1;
109: /**
110: * Cache instances of this class.
111: */
112: public static final int CACHE_STRATEGY_YES = 2;
113: /**
114: * Cache all instances of this class as soon as an instance is requested.
115: * All rows from its table will be read and cached whenever an instance
116: * is requested but not found in cache. This may work well for small
117: * static tables when using a big cache.
118: */
119: public static final int CACHE_STRATEGY_ALL = 3;
120:
121: // type codes for all the simple JDO types
122:
123: public static final int BOOLEAN = 1;
124: public static final int BYTE = 2;
125: public static final int SHORT = 3;
126: public static final int INT = 4;
127: public static final int LONG = 5;
128: public static final int FLOAT = 6;
129: public static final int DOUBLE = 7;
130: public static final int CHAR = 8;
131:
132: // W => Wrapper
133: public static final int BOOLEANW = 9;
134: public static final int BYTEW = 10;
135: public static final int SHORTW = 11;
136: public static final int INTW = 12;
137: public static final int LONGW = 13;
138: public static final int FLOATW = 14;
139: public static final int DOUBLEW = 15;
140: public static final int CHARW = 16;
141:
142: public static final int STRING = 17;
143: public static final int BIGDECIMAL = 18;
144: public static final int BIGINTEGER = 19;
145: public static final int DATE = 20;
146: public static final int LOCALE = 21;
147:
148: public static final int LIST = 22;
149: public static final int ARRAYLIST = 23;
150: public static final int LINKEDLIST = 24;
151: public static final int VECTOR = 25;
152:
153: public static final int SET = 26;
154: public static final int HASHSET = 27;
155: public static final int TREESET = 28;
156: public static final int SORTEDSET = 50;
157:
158: public static final int MAP = 29;
159: public static final int HASHMAP = 30;
160: public static final int TREEMAP = 31;
161: public static final int SORTEDMAP = 51;
162: public static final int HASHTABLE = 32;
163:
164: public static final int COLLECTION = 33;
165:
166: public static final int NULL = 33;
167:
168: public static final int OID = 34;
169:
170: public static final String GEN_START = "HYPERDRIVE_";
171: // all generated class names must start with this string
172: public static final String GEN_OID_START = "HYPERDRIVE_OID_";
173: public static final String GEN_STATE_START = "HYPERDRIVE_STATE_";
174: public static final String OID_STRING_SEPERATOR = "-";
175: public static final char OID_CHAR_SEPERATOR = '-';
176:
177: public static final String STATE_METHOD_STRING = "getStringField";
178: public static final String STATE_METHOD_OBJECT = "getInternalObjectField";
179: public static final String STATE_METHOD_BOOLEAN = "getBooleanField";
180: public static final String STATE_METHOD_BYTE = "getByteField";
181: public static final String STATE_METHOD_SHORT = "getShortField";
182: public static final String STATE_METHOD_INT = "getIntField";
183: public static final String STATE_METHOD_LONG = "getLongField";
184: public static final String STATE_METHOD_FLOAT = "getFloatField";
185: public static final String STATE_METHOD_DOUBLE = "getDoubleField";
186: public static final String STATE_METHOD_CHAR = "getCharField";
187:
188: public static final String EJB_JDBC_PRE_PROCESSOR = "com.versant.core.metadata.EJBAnnotationProcessor";
189:
190: }
|