Package org.geotools.jdbc
Class HeuristicPrimaryKeyFinder
Object
PrimaryKeyFinder
HeuristicPrimaryKeyFinder
Looks up the primary key using the
DatabaseMetaData
for the specified table, looking both for primary keys
and unique indexes. The sequence lookup is performed in conjuction with the sql dialect- Author:
- Andrea Aime - OpenGeo
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetPrimaryKey
(JDBCDataStore store, String databaseSchema, String tableName, Connection cx) Returns thePrimaryKey
, ornull
if a specific type could not be determined (the datastore will fall back onNullPrimaryKey
in that case.
-
Field Details
-
LOGGER
-
-
Constructor Details
-
HeuristicPrimaryKeyFinder
public HeuristicPrimaryKeyFinder()
-
-
Method Details
-
getPrimaryKey
public PrimaryKey getPrimaryKey(JDBCDataStore store, String databaseSchema, String tableName, 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
-