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, ornullif a specific type could not be determined (the datastore will fall back onNullPrimaryKeyin that case.The metadata table name, defaults toGT_PK_METADATAif not specified.The schema containing the table schemavoidsetTableName(String tableName) voidsetTableSchema(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_METADATAif not specified.- See Also:
-
setTableName
-
getPrimaryKey
public PrimaryKey getPrimaryKey(JDBCDataStore store, String schema, String table, Connection cx) throws SQLException Description copied from class:PrimaryKeyFinderReturns thePrimaryKey, ornullif a specific type could not be determined (the datastore will fall back onNullPrimaryKeyin that case. It is advised to return- Specified by:
getPrimaryKeyin classPrimaryKeyFinder- Throws:
SQLException
-