Package org.geotools.jdbc
Class MetadataTablePrimaryKeyFinder
- Object
-
- PrimaryKeyFinder
-
- MetadataTablePrimaryKeyFinder
-
public class MetadataTablePrimaryKeyFinder extends PrimaryKeyFinder
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:
DEFAULT_TABLE
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_TABLE
The default metadata table name: "GT_PK_METADATA".protected static Logger
LOGGER
-
Constructor Summary
Constructors Constructor Description MetadataTablePrimaryKeyFinder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PrimaryKey
getPrimaryKey(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.String
getTableName()
The metadata table name, defaults toGT_PK_METADATA
if not specified.String
getTableSchema()
The schema containing the table schemavoid
setTableName(String tableName)
void
setTableSchema(String tableSchema)
-
-
-
Field Detail
-
LOGGER
protected static final Logger LOGGER
-
DEFAULT_TABLE
public static final String DEFAULT_TABLE
The default metadata table name: "GT_PK_METADATA".- See Also:
- Constant Field Values
-
-
Method Detail
-
getTableSchema
public String getTableSchema()
The schema containing the table schema
-
setTableSchema
public void setTableSchema(String tableSchema)
-
getTableName
public String getTableName()
The metadata table name, defaults toGT_PK_METADATA
if not specified.- See Also:
DEFAULT_TABLE
-
setTableName
public void setTableName(String tableName)
-
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
-
-