001/*
002 * ModeShape (http://www.modeshape.org)
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *       http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.modeshape.jdbc.metadata;
017
018/**
019 * This constants in this class indicate the column positions of different columns in queries against metadata. These constants
020 * are used in JcrResultsMetaData object to obtain column specific metadata information.
021 */
022
023public interface ResultsMetadataConstants {
024
025    // constant indicating the position of catalog .
026    public static final Integer CATALOG = new Integer(0);
027    // constant indicating the position of schema .
028    public static final Integer SCHEMA = new Integer(1);
029    // constant indicating the position of table.
030    public static final Integer TABLE = new Integer(2);
031    // constant indicating the position of column .
032    public static final Integer COLUMN = new Integer(3);
033    // constant indicating the position of column label used for display purposes.
034    public static final Integer COLUMN_LABEL = new Integer(4);
035    // constant indicating the position of datatype of the column.
036    public static final Integer DATA_TYPE = new Integer(6);
037    // constant indicating the position of precision of the column.
038    public static final Integer PRECISION = new Integer(7);
039    // constant indiacting the position of radix of a column.
040    public static final Integer RADIX = new Integer(8);
041    // constant indicating scale of the column.
042    public static final Integer SCALE = new Integer(9);
043    // constant indiacting the position of auto-incrementable property of a column.
044    public static final Integer AUTO_INCREMENTING = new Integer(10);
045    // constant indiacting the position of columns case sensitivity.
046    public static final Integer CASE_SENSITIVE = new Integer(11);
047    // constant indicating the position of nullable property of a column.
048    public static final Integer NULLABLE = new Integer(12);
049    // constant indicating the position of searchable property of a column.
050    public static final Integer SEARCHABLE = new Integer(13);
051    // constant indicating the position of signed property of a column.
052    public static final Integer SIGNED = new Integer(14);
053    // constant indicating the position of updatable property of a column.
054    public static final Integer WRITABLE = new Integer(15);
055    // constant indicating if a column is a currency value
056    public static final Integer CURRENCY = new Integer(16);
057    // constant indicating the display size for a column
058    public static final Integer DISPLAY_SIZE = new Integer(17);
059
060    /**
061     * These types are associated with a DataType or an Element needing the indication of null types.
062     */
063    public static final class NULL_TYPES {
064        public static final Integer NOT_NULL = new Integer(1);
065        public static final Integer NULLABLE = new Integer(2);
066        public static final Integer UNKNOWN = new Integer(3);
067    }
068
069    /**
070     * These types are associated with the Element having valid search types.
071     */
072    public static final class SEARCH_TYPES {
073        public static final Integer SEARCHABLE = new Integer(1);
074        public static final Integer ALLEXCEPTLIKE = new Integer(2);
075        public static final Integer LIKE_ONLY = new Integer(3);
076        public static final Integer UNSEARCHABLE = new Integer(4);
077    }
078
079    public static final class TABLE_TYPES {
080        public static final String VIEW = "VIEW";
081    }
082
083}