org.geotools.jdbc
Class MetadataTablePrimaryKeyFinder

Object
  extended by PrimaryKeyFinder
      extended by MetadataTablePrimaryKeyFinder

public class MetadataTablePrimaryKeyFinder
extends PrimaryKeyFinder

Looks up primary key information in a metadata table provided by the user

The table schema will contain:

By default the table is named 'gt_pk_metadata_table'

Author:
Andrea Aime - OpenGeo

Field Summary
static String DEFAULT_TABLE
          The default metadata table name
protected static Logger LOGGER
           
 
Constructor Summary
MetadataTablePrimaryKeyFinder()
           
 
Method Summary
 PrimaryKey getPrimaryKey(JDBCDataStore store, String schema, String table, 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.
 String getTableName()
          The metadata table name, defaults to gt2_pk_metadata_table if not specified
 String getTableSchema()
          The schema containing the table schema
 void setTableName(String tableName)
           
 void setTableSchema(String tableSchema)
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER

protected static final Logger LOGGER

DEFAULT_TABLE

public static final String DEFAULT_TABLE
The default metadata table name

See Also:
Constant Field Values
Constructor Detail

MetadataTablePrimaryKeyFinder

public MetadataTablePrimaryKeyFinder()
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 to gt2_pk_metadata_table if not specified


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 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.