public interface ColumnMetaData extends Comparable<ColumnMetaData>
SqlResource
,
TableMetaData
Modifier and Type | Method and Description |
---|---|
int |
compareTo(ColumnMetaData column)
Compares another column based on the column number of the select clause in the SQL Resource definition query.
|
String |
getColumnLabel()
Returns column label, a string identified in double quotes after columns in the select clause in the SQL Resource
definition query.
|
String |
getColumnName()
Returns column name, as it is known by the database.
|
int |
getColumnNumber()
Returns column number in the select clause in the SQL Resource definition query.
|
int |
getColumnType()
Returns column type from java.sql.Types.
|
String |
getColumnTypeName()
Returns column type name as given by the database JDBC driver.
|
String |
getDatabaseName()
Returns database name.
|
String |
getQualifiedColumnLabel()
Returns fully qualified column label in database-specific form for use in SQL statements.
|
String |
getQualifiedColumnName()
Returns fully qualified column name in database-specific form for use in SQL statements.
|
String |
getQualifiedTableName()
Returns fully qualified table name in database-specific form for use in SQL statements.
|
Object |
getResultByLabel(ResultSet resultSet)
Returns object from result set using the column label.
|
Object |
getResultByNumber(ResultSet resultSet)
Returns object from result set using the column number.
|
String |
getSequenceName()
Returns sequence name associated with column or null if none.
|
String |
getTableName()
Returns table name.
|
TableMetaData.TableRole |
getTableRole()
Returns role of table in the SQL Resource.
|
boolean |
isBinaryType()
Returns true if type is BINARY, BLOB, JAVA OBJECT or LONGVARBINARY.
|
boolean |
isCharOrDateTimeType()
Returns true if column is a character string or date, time or timestamp.
|
boolean |
isNonqueriedForeignKey()
Returns true for foreign key columns not declared in the SQL Resource query but added by the framework.
|
boolean |
isPrimaryKey()
Returns true if the column is a primary key.
|
boolean |
isReadOnly()
Returns true if the column is read-only, for example derived from SQL function or a database view.
|
boolean |
isSequence()
Returns true if column is associated with a sequence.
|
void |
normalizeValue(RequestValue requestValue)
Converts String value to a numeric Object, Date or UUDecode String into Object if required using the column
metadata.
|
void |
setAttributes(int columnNumber,
String databaseName,
String qualifiedTableName,
String tableName,
String columnName,
String qualifiedColumnName,
String columnLabel,
String qualifiedColumnLabel,
String columnTypeName,
int columnType,
boolean readOnly)
Used for all columns declared in the SqlResource select clause.
|
void |
setAttributes(String databaseName,
String sqlQualifiedTableName,
String tableName,
TableMetaData.TableRole tableRole,
String columnName,
String qualifiedColumnName,
String columnLabel,
String qualifiedColumnLabel,
String columnTypeString)
Used for foreign key columns not declared in the SqlResource select columns.
|
void |
setPrimaryKey(boolean primaryKey)
Sets primary key.
|
void |
setSequence(boolean sequence)
Sets true if column populated with a sequence function (auto increment).
|
void |
setSequenceName(String sequenceName)
Sets sequence name.
|
void |
setTableRole(TableMetaData.TableRole tableRole)
Sets table role.
|
int compareTo(ColumnMetaData column)
compareTo
in interface Comparable<ColumnMetaData>
String getColumnLabel()
String getColumnName()
int getColumnNumber()
int getColumnType()
Types
String getColumnTypeName()
String getDatabaseName()
String getQualifiedColumnLabel()
database.table.label
, for example sakila.film.id
. PostgreSQL can only use
label
and cannot disambiguate by table source.String getQualifiedColumnName()
database.table.column
, for example sakila.film.film_id
. PostgreSQL uses the form
database.schema.table.column
, for example sakila.public.film.film_id
.String getQualifiedTableName()
database.table
, for example sakila.film
. PostgreSQL uses the form
database.schema.table
, for example sakila.public.film
.Object getResultByLabel(ResultSet resultSet) throws SQLException
SQLException
Object getResultByNumber(ResultSet resultSet) throws SQLException
SQLException
String getSequenceName()
String getTableName()
TableMetaData.TableRole getTableRole()
boolean isBinaryType()
boolean isCharOrDateTimeType()
boolean isNonqueriedForeignKey()
boolean isPrimaryKey()
boolean isReadOnly()
boolean isSequence()
getSequenceName()
void normalizeValue(RequestValue requestValue) throws InvalidRequestException
requestValue
- parameter or resource identifierInvalidRequestException
- if conversion failedvoid setAttributes(int columnNumber, String databaseName, String qualifiedTableName, String tableName, String columnName, String qualifiedColumnName, String columnLabel, String qualifiedColumnLabel, String columnTypeName, int columnType, boolean readOnly)
void setAttributes(String databaseName, String sqlQualifiedTableName, String tableName, TableMetaData.TableRole tableRole, String columnName, String qualifiedColumnName, String columnLabel, String qualifiedColumnLabel, String columnTypeString)
void setPrimaryKey(boolean primaryKey)
void setSequence(boolean sequence)
void setSequenceName(String sequenceName)
void setTableRole(TableMetaData.TableRole tableRole)
Copyright © 2011-2018 restSQL Project Contributors