org.geotools.jdbc
Class HeuristicPrimaryKeyFinder

Object
  extended by PrimaryKeyFinder
      extended by HeuristicPrimaryKeyFinder

public class HeuristicPrimaryKeyFinder
extends PrimaryKeyFinder

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
protected static Logger LOGGER
           
 
Constructor Summary
HeuristicPrimaryKeyFinder()
           
 
Method Summary
 PrimaryKey getPrimaryKey(JDBCDataStore store, String databaseSchema, String tableName, Connection cx)
          Returns the PrimaryKey, or null if a specific type could not be determined (the datastore will fall back on NullPrimaryKey in that case.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER

protected static final Logger LOGGER
Constructor Detail

HeuristicPrimaryKeyFinder

public HeuristicPrimaryKeyFinder()
Method Detail

getPrimaryKey

public PrimaryKey getPrimaryKey(JDBCDataStore store,
                                String databaseSchema,
                                String tableName,
                                Connection cx)
                         throws SQLException
Description copied from class: PrimaryKeyFinder
Returns the PrimaryKey, or null if a specific type could not be determined (the datastore will fall back on NullPrimaryKey in that case. It is advised to return

Specified by:
getPrimaryKey in class PrimaryKeyFinder
Returns:
Throws:
SQLException


Copyright © 1996-2014 Geotools. All Rights Reserved.