001: /*
002:
003: Derby - Class org.apache.derby.iapi.sql.ResultColumnDescriptor
004:
005: Licensed to the Apache Software Foundation (ASF) under one or more
006: contributor license agreements. See the NOTICE file distributed with
007: this work for additional information regarding copyright ownership.
008: The ASF licenses this file to you under the Apache License, Version 2.0
009: (the "License"); you may not use this file except in compliance with
010: the License. You may obtain a copy of the License at
011:
012: http://www.apache.org/licenses/LICENSE-2.0
013:
014: Unless required by applicable law or agreed to in writing, software
015: distributed under the License is distributed on an "AS IS" BASIS,
016: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: See the License for the specific language governing permissions and
018: limitations under the License.
019:
020: */
021:
022: package org.apache.derby.iapi.sql;
023:
024: import org.apache.derby.iapi.types.DataTypeDescriptor;
025:
026: /**
027: * A ResultColumnDescriptor describes a result column in a ResultSet.
028: *
029: * @author Jeff Lichtman
030: */
031:
032: public interface ResultColumnDescriptor {
033: /**
034: * Returns a DataTypeDescriptor for the column. This DataTypeDescriptor
035: * will not represent an actual value, it will only represent the type
036: * that all values in the column will have.
037: *
038: * @return A DataTypeDescriptor describing the type of the column.
039: */
040: DataTypeDescriptor getType();
041:
042: /**
043: * Returns the name of the Column.
044: *
045: * @return A String containing the name of the column.
046: */
047: String getName();
048:
049: /**
050: * Get the name of the schema for the Column's base table, if any.
051: * Following example queries will all return APP (assuming user is in schema APP)
052: * select t.a from t
053: * select b.a from t as b
054: * select app.t.a from t
055: *
056: * @return The name of the schema of the Column's base table. If the column
057: * is not in a schema (i.e. is a derived column), it returns NULL.
058: */
059: String getSourceSchemaName();
060:
061: /**
062: * Get the name of the underlying(base) table this column comes from, if any.
063: * Following example queries will all return T
064: * select a from t
065: * select b.a from t as b
066: * select t.a from t
067: *
068: * @return A String containing the name of the base table of the Column
069: * is in. If the column is not in a table (i.e. is a
070: * derived column), it returns NULL.
071: * @return The name of the Column's base table. If the column
072: * is not in a schema (i.e. is a derived column), it returns NULL.
073: */
074: String getSourceTableName();
075:
076: /**
077: * Return true if the column is wirtable by a positioned update.
078: *
079: * @return TRUE, if the column is a base column of a table and is
080: * writable by a positioned update.
081: */
082: boolean updatableByCursor();
083:
084: /**
085: * Get the position of the Column.
086: * NOTE - position is 1-based.
087: *
088: * @return An int containing the position of the Column
089: * within the table.
090: */
091: int getColumnPosition();
092:
093: /**
094: * Tell us if the column is an autoincrement column or not.
095: *
096: * @return TRUE, if the column is a base column of a table and is an
097: * autoincrement column.
098: */
099: boolean isAutoincrement();
100:
101: /*
102: * NOTE: These interfaces are intended to support JDBC. There are some
103: * JDBC methods on java.sql.ResultSetMetaData that have no equivalent
104: * here, mainly because they are of questionable use to us. They are:
105: * getCatalogName() (will we support catalogs?), getColumnLabel(),
106: * isCaseSensitive(), isCurrency(),
107: * isDefinitelyWritable(), isReadOnly(), isSearchable(), isSigned(),
108: * isWritable()). The JDBC driver implements these itself, using
109: * the data type information and knowing data type characteristics.
110: */
111: }
|