View Javadoc

1   /*
2    * ModeShape (http://www.modeshape.org)
3    * See the COPYRIGHT.txt file distributed with this work for information
4    * regarding copyright ownership.  Some portions may be licensed
5    * to Red Hat, Inc. under one or more contributor license agreements.
6    * See the AUTHORS.txt file in the distribution for a full listing of 
7    * individual contributors.
8    *
9    * ModeShape is free software. Unless otherwise indicated, all code in ModeShape
10   * is licensed to you under the terms of the GNU Lesser General Public License as
11   * published by the Free Software Foundation; either version 2.1 of
12   * the License, or (at your option) any later version.
13   * 
14   * ModeShape is distributed in the hope that it will be useful,
15   * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17   * Lesser General Public License for more details.
18   *
19   * You should have received a copy of the GNU Lesser General Public
20   * License along with this software; if not, write to the Free
21   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
22   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
23   */
24  package org.modeshape.jdbc.metadata;
25  
26  /* <p> This class contains constants indicating names of the columns in the
27   *  result sets returned by methods on JcrMetaData. Each inner class represents
28   *  a particular method and the class attributes give the names of the columns on
29   *  methods ResultSet.</p>
30   */
31  
32  public interface JDBCColumnNames {
33  
34      /**
35       * This class contains constants representing column names on ResultSet
36       * returned by getCatalogs method on DatabaseMetaData. These constant values
37       * are be used for the column names used in constructing the ResultSet obj.
38       */
39      interface CATALOGS {
40          //  name of the column containing catalog or Virtual database name.
41          static final String TABLE_CAT = "TABLE_CAT"; //$NON-NLS-1$
42      }
43  
44      /**
45       * This class contains constants representing column names on ResultSet
46       * returned by getColumns method on DatabaseMetaData. These constant values
47       * are be used to hardcode the column names used in constructin the ResultSet obj.
48       */
49      interface COLUMNS {
50  
51          //  name of the column containing catalog or Virtual database name.
52          static final String TABLE_CAT = "TABLE_CAT"; //$NON-NLS-1$
53  
54          //  name of the column containing schema or Virtual database version.
55          static final String TABLE_SCHEM = "TABLE_SCHEM"; //$NON-NLS-1$
56  
57          //  name of the column containing table or group name.
58          static final String TABLE_NAME = "TABLE_NAME"; //$NON-NLS-1$
59  
60          //  name of the column containing column or element name.
61          static final String COLUMN_NAME = "COLUMN_NAME"; //$NON-NLS-1$
62  
63          /** name of column that contains SQL type from java.sql.Types for column's data type. */
64          static final String DATA_TYPE = "DATA_TYPE"; //$NON-NLS-1$
65  
66          /** name of column that contains local type name used by the data source. */
67          static final String TYPE_NAME = "TYPE_NAME"; //$NON-NLS-1$
68  
69          //  name of the column containing column size.
70          static final String COLUMN_SIZE = "COLUMN_SIZE"; //$NON-NLS-1$
71  
72          /** name of column that is not used will contain nulls */
73          static final String BUFFER_LENGTH = "BUFFER_LENGTH"; //$NON-NLS-1$
74  
75          //  name of the column containing number of digits to right of decimal
76          static final String DECIMAL_DIGITS = "DECIMAL_DIGITS"; //$NON-NLS-1$
77  
78          //  name of the column containing column's Radix.
79          static final String NUM_PREC_RADIX = "NUM_PREC_RADIX"; //$NON-NLS-1$
80  
81          /** name of column that has an String value indicating nullablity */
82          static final String NULLABLE = "NULLABLE"; //$NON-NLS-1$
83  
84          /** name of column containing explanatory notes. */
85          static final String REMARKS = "REMARKS"; //$NON-NLS-1$
86  
87          /** name of column which contails default value for the column. */
88          static final String COLUMN_DEF = "COLUMN_DEF"; //$NON-NLS-1$
89  
90          /** name of column that not used will contain nulls */
91          static final String SQL_DATA_TYPE = "SQL_DATA_TYPE"; //$NON-NLS-1$
92  
93          /** name of column that not used will contain nulls */
94          static final String SQL_DATETIME_SUB = "SQL_DATETIME_SUB"; //$NON-NLS-1$
95  
96          /** name of column that stores the max number of bytes in the column */
97          static final String CHAR_OCTET_LENGTH = "CHAR_OCTET_LENGTH"; //$NON-NLS-1$
98  
99          /** name of column that stores the index of a column in the table */
100         static final String ORDINAL_POSITION = "ORDINAL_POSITION"; //$NON-NLS-1$
101 
102         /** name of column that has an String value indicating nullablity */
103         static final String IS_NULLABLE = "IS_NULLABLE"; //$NON-NLS-1$
104 
105         /** name of column that is the scope of a reference attribute (null if DATA_TYPE isn't REF)*/ 
106         static final String SCOPE_CATLOG = "SCOPE_CATLOG"; //$NON-NLS-1$
107         
108         /** name of column that is the scope of a reference attribute (null if the DATA_TYPE isn't REF) */ 
109         static final String SCOPE_SCHEMA = "SCOPE_SCHEMA"; //$NON-NLS-1$
110         
111         /** name of column that is the scope of a reference attribure (null if the DATA_TYPE isn't REF) */
112         static final String SCOPE_TABLE = "SCOPE_TABLE"; //$NON-NLS-1$
113         
114         /** 
115          * name of column that is source type of a distinct type or user-generated Ref type, SQL type
116          * from java.sql.Types (null if DATA_TYPE isn't DISTINCT or user-generated REF)
117          */ 
118         static final String SOURCE_DATA_TYPE = "SOURCE_DATA_TYPE"; //$NON-NLS-1$
119         
120         /** name of column that has an String value indicating format */
121         static final String FORMAT = "FORMAT"; //$NON-NLS-1$
122 
123         /** name of column that has an String value indicating minimum range */
124         static final String MIN_RANGE = "MIN_RANGE"; //$NON-NLS-1$
125 
126         /** name of column that has an String value indicating maximum range */
127         static final String MAX_RANGE = "MAX_RANGE"; //$NON-NLS-1$
128      }
129 
130 
131     /**
132      * This class contains constants representing column names on ResultSet
133      * returned by getSchemas method on DatabaseMetaData. These constant values
134      * are be used to hardcode the column names used in constructin the ResultSet obj.
135      */
136     interface SCHEMAS {
137 
138         // name of the column containing procedure catalog or Virtual database name.
139         static final String TABLE_SCHEM = "TABLE_SCHEM"; //$NON-NLS-1$
140 
141         // name of the column containing schema or Virtual database version.
142         static final String TABLE_CATALOG = "TABLE_CATALOG"; //$NON-NLS-1$
143 
144     }
145 
146     /**
147      * This class contains constants representing column names on ResultSet
148      * returned by getTables and getTableTypes methods on DatabaseMetaData. These
149      * constant values are be used to hardcode the column names used in construction
150      * the ResultSet obj.
151      */
152     interface TABLES {
153 
154         // name of the column containing catalog or Virtual database name.
155         static final String TABLE_CAT = "TABLE_CAT"; //$NON-NLS-1$
156 
157         // name of the column containing schema or Virtual database version.
158         static final String TABLE_SCHEM = "TABLE_SCHEM"; //$NON-NLS-1$
159 
160         // name of the column containing table or group name.
161         static final String TABLE_NAME = "TABLE_NAME"; //$NON-NLS-1$
162 
163         // name of the column containing table or group type.
164         static final String TABLE_TYPE = "TABLE_TYPE"; //$NON-NLS-1$
165 
166         /** name of column containing explanatory notes. */
167         static final String REMARKS = "REMARKS"; //$NON-NLS-1$
168         static final String TYPE_CAT = "TYPE_CAT"; //$NON-NLS-1$
169         static final String TYPE_SCHEM = "TYPE_SCHEM"; //$NON-NLS-1$
170         static final String TYPE_NAME = "TYPE_NAME"; //$NON-NLS-1$
171         static final String SELF_REFERENCING_COL_NAME = "SELF_REFERENCING_COL_NAME"; //$NON-NLS-1$
172         static final String REF_GENERATION = "REF_GENERATION"; //$NON-NLS-1$
173         static final String ISPHYSICAL = "ISPHYSICAL"; //$NON-NLS-1$
174     
175     }
176 
177     /**
178      * This class contains constants representing column names on ResultSet
179      * returned by getTables and getTableTypes methods on DatabaseMetaData. These
180      * constant values are be used to hardcode the column names used in construction
181      * the ResultSet obj.
182      */
183     interface TABLE_TYPES {
184 
185         // name of the column containing table or group type.
186         static final String TABLE_TYPE = "TABLE_TYPE"; //$NON-NLS-1$
187     }
188 
189     /**
190      * This class contains constants representing column names on ResultSet
191      * returned by getTypeInfo method on DatabaseMetaData. These constant values
192      * are be used to hardcode the column names used in constructin the ResultSet obj.
193      */
194     interface TYPE_INFO {
195 
196         /** name of column that contains local type name used by the data source. */
197         static final String TYPE_NAME = "TYPE_NAME"; //$NON-NLS-1$
198 
199         /** name of column that contains SQL type from java.sql.Types for column's data type. */
200         static final String DATA_TYPE = "DATA_TYPE"; //$NON-NLS-1$
201 
202         // name of the column containing number of digits to right of decimal
203         static final String PRECISION = "PRECISION"; //$NON-NLS-1$
204 
205         // name of the column containing prefix used to quote a literal
206         static final String LITERAL_PREFIX = "LITERAL_PREFIX"; //$NON-NLS-1$
207 
208         // name of the column containing suffix used to quote a literal
209         static final String LITERAL_SUFFIX = "LITERAL_SUFFIX"; //$NON-NLS-1$
210 
211         // name of the column containing params used in creating the type
212         static final String CREATE_PARAMS = "CREATE_PARAMS"; //$NON-NLS-1$
213 
214         /** name of column that has an String value indicating nullablity */
215         static final String NULLABLE = "NULLABLE"; //$NON-NLS-1$
216 
217         /** name of column that has an String value indicating case sensitivity */
218         static final String CASE_SENSITIVE = "CASE_SENSITIVE"; //$NON-NLS-1$
219 
220         /** name of column that has an String value indicating searchability */
221         static final String SEARCHABLE = "SEARCHABLE"; //$NON-NLS-1$
222 
223         /** name of column that has an String value indicating searchability */
224         static final String UNSIGNED_ATTRIBUTE = "UNSIGNED_ATTRIBUTE"; //$NON-NLS-1$
225 
226         /** name of column that contains info if the column is a currency value */
227         static final String FIXED_PREC_SCALE = "FIXED_PREC_SCALE"; //$NON-NLS-1$
228 
229         /** name of column that contains info whether the column is autoincrementable */
230         static final String AUTOINCREMENT = "AUTO_INCREMENT"; //$NON-NLS-1$
231 
232         /** name of column that localised version of type name */
233         static final String LOCAL_TYPE_NAME = "LOCAL_TYPE_NAME"; //$NON-NLS-1$
234 
235         /** name of column that gives the min scale supported */
236         static final String MINIMUM_SCALE = "MINIMUM_SCALE"; //$NON-NLS-1$
237 
238         /** name of column that gives the max scale supported */
239         static final String MAXIMUM_SCALE = "MAXIMUM_SCALE"; //$NON-NLS-1$
240 
241         /** name of column that not used will contain nulls */
242         static final String SQL_DATA_TYPE = "SQL_DATA_TYPE"; //$NON-NLS-1$
243 
244         /** name of column that not used will contain nulls */
245         static final String SQL_DATETIME_SUB = "SQL_DATETIME_SUB"; //$NON-NLS-1$
246 
247         // constant indiacting column's Radix.
248         static final String NUM_PREC_RADIX = "NUM_PREC_RADIX"; //$NON-NLS-1$
249     }
250 
251 }