Package org.geotools.jdbc
Class MetadataTablePrimaryKeyFinder
Object
PrimaryKeyFinder
MetadataTablePrimaryKeyFinder
Looks up primary key information in a metadata table provided by the user.
The table schema will contain:
- table_schema (varchar): schema name
- table_name (varchar): table name
- pk_column (varchar): column name
- pk_column_idx (integer): column index if pk is multicolumn (nullable)
- pk_policy (varchar): pk assignment policy: "assigned", "sequence", "autogenerated"
- pk_sequence (varchar): full name of the sequence to be used to generate the next value, if any
- Author:
- Andrea Aime - OpenGeo
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetPrimaryKey
(JDBCDataStore store, String schema, String table, Connection cx) Returns thePrimaryKey
, ornull
if a specific type could not be determined (the datastore will fall back onNullPrimaryKey
in that case.The metadata table name, defaults toGT_PK_METADATA
if not specified.The schema containing the table schemavoid
setTableName
(String tableName) void
setTableSchema
(String tableSchema)
-
Field Details
-
LOGGER
-
DEFAULT_TABLE
The default metadata table name: "GT_PK_METADATA".- See Also:
-
-
Constructor Details
-
MetadataTablePrimaryKeyFinder
public MetadataTablePrimaryKeyFinder()
-
-
Method Details
-
getTableSchema
The schema containing the table schema -
setTableSchema
-
getTableName
The metadata table name, defaults toGT_PK_METADATA
if not specified.- See Also:
-
setTableName
-
getPrimaryKey
public PrimaryKey getPrimaryKey(JDBCDataStore store, String schema, String table, Connection cx) throws SQLException Description copied from class:PrimaryKeyFinder
Returns thePrimaryKey
, ornull
if a specific type could not be determined (the datastore will fall back onNullPrimaryKey
in that case. It is advised to return- Specified by:
getPrimaryKey
in classPrimaryKeyFinder
- Throws:
SQLException
-