KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > versant > core > jdbc > metadata > JdbcMetaDataEnums


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.jdbc.metadata;
13
14 import com.versant.core.jdbc.metadata.JdbcClass;
15 import com.versant.core.jdbc.metadata.JdbcRefField;
16 import com.versant.core.metadata.MDStatics;
17
18 import java.util.Map JavaDoc;
19 import java.util.HashMap JavaDoc;
20
21 /**
22  * This contains maps that convert Strings to int codes for JDBC meta data
23  * options. They are not static so this class can be completly discarded
24  * when the meta data has been read.
25  */

26 public class JdbcMetaDataEnums {
27
28     public static final String JavaDoc OPTIMISTIC_LOCKING_NONE = "none";
29     public static final String JavaDoc OPTIMISTIC_LOCKING_VERSION = "version";
30     public static final String JavaDoc OPTIMISTIC_LOCKING_TIMESTAMP = "timestamp";
31     public static final String JavaDoc OPTIMISTIC_LOCKING_CHANGED = "changed";
32
33     public final Map JavaDoc USE_JOIN_ENUM;
34     public final Map JavaDoc OPTIMISTIC_LOCKING_ENUM;
35     public final Map JavaDoc INHERITANCE_ENUM;
36
37     public static final String JavaDoc INHERITANCE_FLAT = "flat";
38     public static final String JavaDoc INHERITANCE_VERTICAL = "vertical";
39     public static final String JavaDoc INHERITANCE_HORIZONTAL = "horizontal";
40
41     public JdbcMetaDataEnums() {
42         USE_JOIN_ENUM = new HashMap JavaDoc();
43         USE_JOIN_ENUM.put("no", new Integer JavaDoc(JdbcRefField.USE_JOIN_NO));
44         USE_JOIN_ENUM.put("inner", new Integer JavaDoc(JdbcRefField.USE_JOIN_INNER));
45         USE_JOIN_ENUM.put("outer", new Integer JavaDoc(JdbcRefField.USE_JOIN_OUTER));
46
47         OPTIMISTIC_LOCKING_ENUM = new HashMap JavaDoc();
48         OPTIMISTIC_LOCKING_ENUM.put(OPTIMISTIC_LOCKING_NONE, new Integer JavaDoc(JdbcClass.OPTIMISTIC_LOCKING_NONE));
49         OPTIMISTIC_LOCKING_ENUM.put(OPTIMISTIC_LOCKING_VERSION, new Integer JavaDoc(JdbcClass.OPTIMISTIC_LOCKING_VERSION));
50         OPTIMISTIC_LOCKING_ENUM.put(OPTIMISTIC_LOCKING_TIMESTAMP, new Integer JavaDoc(JdbcClass.OPTIMISTIC_LOCKING_TIMESTAMP));
51         OPTIMISTIC_LOCKING_ENUM.put(OPTIMISTIC_LOCKING_CHANGED, new Integer JavaDoc(JdbcClass.OPTIMISTIC_LOCKING_CHANGED));
52
53         INHERITANCE_ENUM = new HashMap JavaDoc();
54         INHERITANCE_ENUM.put(INHERITANCE_FLAT, new Integer JavaDoc(JdbcClass.INHERITANCE_FLAT));
55         INHERITANCE_ENUM.put(INHERITANCE_VERTICAL, new Integer JavaDoc(JdbcClass.INHERITANCE_VERTICAL));
56         INHERITANCE_ENUM.put(INHERITANCE_HORIZONTAL, new Integer JavaDoc(JdbcClass.INHERITANCE_HORIZONTAL));
57     }
58 }
59
Popular Tags