public class TableMetadataResultSetBuilder extends AbstractMetadataResultSetBuilder
CassandraMetadataResultSet objects) related to tables.| Constructor and Description |
|---|
TableMetadataResultSetBuilder(CassandraStatement statement)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
CassandraMetadataResultSet |
buildBestRowIdentifier(String schema,
String table,
int scope)
Builds a valid result set of the description of a table's optimal set of columns that uniquely identifies a row.
|
CassandraMetadataResultSet |
buildIndexes(String schema,
String tableName,
boolean unique,
boolean approximate)
Builds a valid result set of the description of the given table's indices and statistics.
|
CassandraMetadataResultSet |
buildPrimaryKeys(String schema,
String tableName)
Builds a valid result set of the description of the given table's primary key columns.
|
CassandraMetadataResultSet |
buildTables(String schemaPattern,
String tableNamePattern)
Builds a valid result set of the description of the tables available in the given catalog (Cassandra cluster).
|
CassandraMetadataResultSet |
buildTableTypes()
Builds a valid result set of the table types available in Cassandra database.
|
matchesPatternpublic TableMetadataResultSetBuilder(CassandraStatement statement) throws SQLException
statement - The statement.SQLException - if a database access error occurs or this statement is closed.public CassandraMetadataResultSet buildTableTypes() throws SQLException
DatabaseMetaData.getTableTypes().
The columns of this result set are:
DatabaseMetaData.getTableTypes().SQLException - when something went wrong during the creation of the result set.public CassandraMetadataResultSet buildTables(String schemaPattern, String tableNamePattern) throws SQLException
DatabaseMetaData.getTables(String, String, String, String[]).
Only table descriptions matching the catalog, schema, table name and type criteria are returned. They are
ordered by TABLE_CAT, TABLE_SCHEM and TABLE_NAME.
The columns of this result set are:
null: here is the Cassandra cluster name
(if available).null: here is the keyspace the table is
member of.null here.null here.null here.null here.SELF_REFERENCING_COL_NAME are
created: always null here.schemaPattern - A schema name pattern. It must match the schema name as it is stored in the database;
"" retrieves those without a schema and null means that the schema name
should not be used to narrow the search. Using "" as the same effect as
null because here the schema corresponds to the keyspace and Cassandra tables
cannot be defined outside a keyspace.tableNamePattern - A table name pattern. It must match the table name as it is stored in the database.DatabaseMetaData.getTables(String, String, String, String[]).SQLException - when something went wrong during the creation of the result set.public CassandraMetadataResultSet buildIndexes(String schema, String tableName, boolean unique, boolean approximate) throws SQLException
DatabaseMetaData.getIndexInfo(String, String, String, boolean, boolean).
Only indexes of the table exactly matching the catalog, schema and table name are returned. They are
ordered by NON_UNIQUE, TYPE, INDEX_NAME and ORDINAL_POSITION.
The columns of this result set are:
null: here is the Cassandra cluster name
(if available).null: here is the keyspace the table is
member of.false when TYPE is
DatabaseMetaData.tableIndexStatistic. Always true here.null when TYPE is
DatabaseMetaData.tableIndexStatistic.null when TYPE is
DatabaseMetaData.tableIndexStatistic.DatabaseMetaData.tableIndexStatistic - this identifies table statistics that are
returned in conjunction with a table's index descriptionsDatabaseMetaData.tableIndexClustered - this is a clustered indexDatabaseMetaData.tableIndexHashed - this is a hashed indexDatabaseMetaData.tableIndexOther - this is some other style of indexDatabaseMetaData.tableIndexHashed here.
TYPE is
DatabaseMetaData.tableIndexStatistic. Always 1 here.null when TYPE is
DatabaseMetaData.tableIndexStatistic.null if sort sequence is not supported or when TYPE is
DatabaseMetaData.tableIndexStatistic. Always null here.TYPE is DatabaseMetaData.tableIndexStatistic, then
this is the number of rows in the table; otherwise, it is the number of unique values in the index.
Always -1 here.TYPE is DatabaseMetaData.tableIndexStatistic, then
this is the number of pages used for the table; otherwise, it is the number of pages used for the
current index. Always -1 here.null here.schema - A schema name. It must match the schema name as it is stored in the database; ""
retrieves those without a schema and null means that the schema name should not be
used to narrow down the search.tableName - A table name. It must match the table name as it is stored in the database.unique - when true, return only indices for unique values; when false, return
indices regardless of whether unique or not. This parameter has no effect here.approximate - when true, result is allowed to reflect approximate or out of data values; when
false, results are requested to be accurate. This parameter has no effect here.DatabaseMetaData.getIndexInfo(String, String, String, boolean, boolean).SQLException - when something went wrong during the creation of the result set.public CassandraMetadataResultSet buildPrimaryKeys(String schema, String tableName) throws SQLException
DatabaseMetaData.getPrimaryKeys(String, String, String).
Only primary keys of the table exactly matching the catalog, schema and table name are returned. They are
ordered by COLUMN_NAME.
The columns of this result set are:
null: here is the Cassandra cluster name
(if available).null: here is the keyspace the table is
member of.null here.schema - A schema name. It must match the schema name as it is stored in the database; ""
retrieves those without a schema and null means that the schema name should not be
used to narrow down the search.tableName - A table name. It must match the table name as it is stored in the database.DatabaseMetaData.getPrimaryKeys(String, String, String).SQLException - when something went wrong during the creation of the result set.public CassandraMetadataResultSet buildBestRowIdentifier(String schema, String table, int scope) throws SQLException
DatabaseMetaData.getBestRowIdentifier(String, String, String, int, boolean).
In Cassandra, all the tables must define a single primary key and the columns defining this primary key
ensure the uniqueness of each row. So, we consider in this implementation that the best row identifier for
a table is always its primary key regardless of the specified scope. Also, the parameter nullable has
no effect here since Cassandra does not allow null values in primary keys.
Only identifiers for tables matching the catalog, schema and table name criteria are returned. They are
ordered by SCOPE.
The columns of this result set are:
DatabaseMetaData.bestRowTemporary - very temporary, while using rowDatabaseMetaData.bestRowTransaction - valid for remainder of current transactionDatabaseMetaData.bestRowSession - valid for remainder of current sessionTypes.null is returned for data
types where it is not applicable. Always null here.DatabaseMetaData.bestRowUnknown - may or may not be pseudo columnDatabaseMetaData.bestRowNotPseudo - is not a pseudo columnDatabaseMetaData.bestRowPseudo - is a pseudo columnDatabaseMetaData.bestRowNotPseudo here since there is no concept of pseudo
column in Cassandra.
schema - A schema name pattern. It must match the schema name as it is stored in the database; ""
retrieves those without a schema and null means that the schema name should not be used
to narrow the search. Using "" as the same effect as null because here the schema
corresponds to the keyspace and Cassandra tables cannot be defined outside a keyspace.table - A table name. It must match the table name as it is stored in the database.scope - The scope of interest, using the same values as SCOPE in the result set.DatabaseMetaData.getBestRowIdentifier(String, String, String, int, boolean).SQLException - when something went wrong during the creation of the result set.Copyright © 2020–2024 ING Bank. All rights reserved.