Package org.geotools.jdbc
Class HeuristicPrimaryKeyFinder
- Object
-
- PrimaryKeyFinder
-
- HeuristicPrimaryKeyFinder
-
public class HeuristicPrimaryKeyFinder extends PrimaryKeyFinder
Looks up the primary key using theDatabaseMetaData
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
-
-
Constructor Summary
Constructors Constructor Description HeuristicPrimaryKeyFinder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PrimaryKey
getPrimaryKey(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 Detail
-
LOGGER
protected static final Logger LOGGER
-
-
Method Detail
-
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
-
-