org.geotools.jdbc
Class MetadataTablePrimaryKeyFinder

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

Field Detail

LOGGER

protected static final java.util.logging.Logger LOGGER

DEFAULT_TABLE

public static final java.lang.String DEFAULT_TABLE
The default metadata table name

See Also:
Constant Field Values
Constructor Detail

MetadataTablePrimaryKeyFinder

public MetadataTablePrimaryKeyFinder()
Method Detail

getTableSchema

public java.lang.String getTableSchema()
The schema containing the table schema


setTableSchema

public void setTableSchema(java.lang.String tableSchema)

getTableName

public java.lang.String getTableName()
The metadata table name, defaults to gt2_pk_metadata_table if not specified


setTableName

public void setTableName(java.lang.String tableName)

getPrimaryKey

public PrimaryKey getPrimaryKey(JDBCDataStore store,
                                java.lang.String schema,
                                java.lang.String table,
                                java.sql.Connection cx)
                         throws java.sql.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:
java.sql.SQLException


Copyright © 1996-2010 Geotools. All Rights Reserved.