public class TypeMetadataResultSetBuilder extends AbstractMetadataResultSetBuilder
CassandraMetadataResultSet objects) related to types.| Constructor and Description |
|---|
TypeMetadataResultSetBuilder(CassandraStatement statement)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
CassandraMetadataResultSet |
buildAttributes(String schemaPattern,
String typeNamePattern,
String attributesNamePattern)
Builds a valid result set of the description of the given attribute of the given type for a user-defined type
(UDT) that is available in the given schema.
|
CassandraMetadataResultSet |
buildTypes(String databaseVersion)
Builds a valid result set of all the data types supported by this database.
|
CassandraMetadataResultSet |
buildUDTs(String schemaPattern,
String typeNamePattern,
int[] types)
Builds a valid result set of the description of the user-defined types (UDTs) defined in a particular schema.
|
matchesPatternpublic TypeMetadataResultSetBuilder(CassandraStatement statement) throws SQLException
statement - The statement.SQLException - if a database access error occurs or this statement is closed.public CassandraMetadataResultSet buildUDTs(String schemaPattern, String typeNamePattern, int[] types) throws SQLException
DatabaseMetaData.getUDTs(String, String, String, int[]).
Schema-specific UDTs in a Cassandra database will be considered as having type JAVA_OBJECT.
Only types matching the catalog, schema, type name and type criteria are returned. They are ordered by
DATA_TYPE, TYPE_CAT, TYPE_SCHEM and TYPE_NAME. The type name parameter may be
a fully-qualified name (it should respect the format <SCHEMA_NAME>.<TYPE_NAME>). In this case, the
catalog and schemaPattern parameters are ignored.
The columns of this result set are:
null: here is the Cassandra cluster name
(if available).null: here is the keyspace the type is
member of.UdtValue in the current implementation.Types. One of Types.JAVA_OBJECT,
Types.STRUCT, or Types.DISTINCT. Always Types.JAVA_OBJECT in the current
implementation.DISTINCT type or the type that
implements the user-generated reference type of the SELF_REFERENCING_COLUMN of a structured type
as defined in Types (null if DATA_TYPE is not DISTINCT or not
STRUCT with REFERENCE_GENERATION = USER_DEFINED). Always null in the current
implementation.schemaPattern - A schema pattern name; must match the schema name as it is stored in the database;
"" retrieves those without a schema (will always return an empty set);
null means that the schema name should not be used to narrow the search and in
this case the search is restricted to the current schema (if available).typeNamePattern - A type name pattern; must match the type name as it is stored in the database (not
case-sensitive); may be a fully qualified name.types - A list of user-defined types (Types.JAVA_OBJECT, Types.STRUCT, or
Types.DISTINCT) to include; null returns all types. All the UDTs defined
in a Cassandra database are considered as Types.JAVA_OBJECT, so other values will
return an empty result set.DatabaseMetaData.getUDTs(String, String, String, int[]).SQLException - when something went wrong during the creation of the result set.public CassandraMetadataResultSet buildTypes(String databaseVersion) throws SQLException
DatabaseMetaData.getTypeInfo().
They are ordered by DATA_TYPE and then by how closely the data type maps to the corresponding JDBC SQL type.
The Cassandra database does not support SQL distinct types. The information on the individual structured types
(considered as Types.JAVA_OBJECT, not Types.STRUCT) may be obtained from the getUDTs()
method.
The columns of this result set are:
Types.null).null).null).NULL for this type:
DatabaseMetaData.typeNoNulls - does not allow NULL valuesDatabaseMetaData.typeNullable - allows NULL valuesDatabaseMetaData.typeNullableUnknown - nullability unknownWHERE" based on this type:
DatabaseMetaData.typePredNone - no supportDatabaseMetaData.typePredChar - only supported with WHERE .. LIKEDatabaseMetaData.typePredBasic - supported except for WHERE .. LIKEDatabaseMetaData.typeSearchable - supported for all WHERE ..false
since Cassandra does not support auto-increment.null).
The PRECISION column represents the maximum column size that the server supports for the given datatype.
For numeric data, this is the maximum precision. For character data, this is the length in characters. For
datetime data types, this is the length in characters of the String representation (assuming the maximum
allowed precision of the fractional seconds component). For binary data, this is the length in bytes.
For the ROWID datatype (not supported by Cassandra), this is the length in bytes. The value null
is returned for data types where the column size is not applicable.
databaseVersion - The database version the driver is currently connected to.DatabaseMetaData.getTypeInfo().SQLException - when something went wrong during the creation of the result set.public CassandraMetadataResultSet buildAttributes(String schemaPattern, String typeNamePattern, String attributesNamePattern) throws SQLException
DatabaseMetaData.getAttributes(String, String, String, String).
Only descriptions for attributes of UDTs matching the catalog, schema, type and attribute criteria are returned.
They are ordered by TYPE_CAT, TYPE_SCHEM and TYPE_NAME and ORDINAL_POSITION.
This description does not contain inherited attributes.
The type name parameter may be a fully-qualified name (it should respect the format
<SCHEMA_NAME>.<TYPE_NAME>). In this case, the catalog and schemaPattern parameters are
ignored.
The columns of this result set are:
null: here is the Cassandra cluster name
(if available).null: here is the keyspace the type is
member of.Types.REF in Cassandra.null is returned for data
types where it is not applicable. Always null here.NULL allowed:
DatabaseMetaData.attributeNoNulls - might not allow NULL valuesDatabaseMetaData.attributeNullable - definitely allows NULL valuesDatabaseMetaData.attributeNullableUnknown - nullability unknownDatabaseMetaData.attributeNoNulls here.
null:
always null here since comments on columns does not exist in Cassandra.null since Cassandra does not
support default values.null here.null here.NULLsNULLsnull if DATA_TYPE isn't REF). Always null here.null if DATA_TYPE isn't REF). Always null here.null if DATA_TYPE isn't REF). Always null here.Types (null if DATA_TYPE isn't DISTINCT or user-generated
REF). Always null here.schemaPattern - A schema pattern name; must match the schema name as it is stored in the database;
"" retrieves those without a schema (will always return an empty set);
null means that the schema name should not be used to narrow the search and
in this case the search is restricted to the current schema (if available).typeNamePattern - A type name pattern; must match the type name as it is stored in the database (not
case-sensitive); may be a fully qualified name.attributesNamePattern - An attribute name pattern; must match the attribute name as it is declared in the
database (not case-sensitive).DatabaseMetaData.getAttributes(String, String, String, String).SQLException - when something went wrong during the creation of the result set.Copyright © 2020–2024 ING Bank. All rights reserved.