01: /*
02: * Copyright (c) 1998 - 2005 Versant Corporation
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * Versant Corporation - initial API and implementation
10: */
11: package com.versant.core.jdbc.metadata;
12:
13: import com.versant.core.jdbc.metadata.JdbcClass;
14: import com.versant.core.jdbc.metadata.JdbcRefField;
15: import com.versant.core.metadata.MDStatics;
16:
17: import java.util.Map;
18: import java.util.HashMap;
19:
20: /**
21: * This contains maps that convert Strings to int codes for JDBC meta data
22: * options. They are not static so this class can be completly discarded
23: * when the meta data has been read.
24: */
25: public class JdbcMetaDataEnums {
26:
27: public static final String OPTIMISTIC_LOCKING_NONE = "none";
28: public static final String OPTIMISTIC_LOCKING_VERSION = "version";
29: public static final String OPTIMISTIC_LOCKING_TIMESTAMP = "timestamp";
30: public static final String OPTIMISTIC_LOCKING_CHANGED = "changed";
31:
32: public final Map USE_JOIN_ENUM;
33: public final Map OPTIMISTIC_LOCKING_ENUM;
34: public final Map INHERITANCE_ENUM;
35:
36: public static final String INHERITANCE_FLAT = "flat";
37: public static final String INHERITANCE_VERTICAL = "vertical";
38: public static final String INHERITANCE_HORIZONTAL = "horizontal";
39:
40: public JdbcMetaDataEnums() {
41: USE_JOIN_ENUM = new HashMap();
42: USE_JOIN_ENUM.put("no", new Integer(JdbcRefField.USE_JOIN_NO));
43: USE_JOIN_ENUM.put("inner", new Integer(
44: JdbcRefField.USE_JOIN_INNER));
45: USE_JOIN_ENUM.put("outer", new Integer(
46: JdbcRefField.USE_JOIN_OUTER));
47:
48: OPTIMISTIC_LOCKING_ENUM = new HashMap();
49: OPTIMISTIC_LOCKING_ENUM.put(OPTIMISTIC_LOCKING_NONE,
50: new Integer(JdbcClass.OPTIMISTIC_LOCKING_NONE));
51: OPTIMISTIC_LOCKING_ENUM.put(OPTIMISTIC_LOCKING_VERSION,
52: new Integer(JdbcClass.OPTIMISTIC_LOCKING_VERSION));
53: OPTIMISTIC_LOCKING_ENUM.put(OPTIMISTIC_LOCKING_TIMESTAMP,
54: new Integer(JdbcClass.OPTIMISTIC_LOCKING_TIMESTAMP));
55: OPTIMISTIC_LOCKING_ENUM.put(OPTIMISTIC_LOCKING_CHANGED,
56: new Integer(JdbcClass.OPTIMISTIC_LOCKING_CHANGED));
57:
58: INHERITANCE_ENUM = new HashMap();
59: INHERITANCE_ENUM.put(INHERITANCE_FLAT, new Integer(
60: JdbcClass.INHERITANCE_FLAT));
61: INHERITANCE_ENUM.put(INHERITANCE_VERTICAL, new Integer(
62: JdbcClass.INHERITANCE_VERTICAL));
63: INHERITANCE_ENUM.put(INHERITANCE_HORIZONTAL, new Integer(
64: JdbcClass.INHERITANCE_HORIZONTAL));
65: }
66: }
|