org.geotools.data.postgis.fidmapper
Class PostgisFIDMapperFactory

Object
  extended by DefaultFIDMapperFactory
      extended by PostgisFIDMapperFactory
All Implemented Interfaces:
FIDMapperFactory

public class PostgisFIDMapperFactory
extends DefaultFIDMapperFactory

Postgis specific FIDMapperFactory that uses the OIDFidMapper to map tables with no primary keys or tables that have weird primary keys that cannot be mapped in other ways.

Author:
Andrea Aime
Module:
modules/plugin/postgis (gt-postgis.jar)

Nested Class Summary
 
Nested classes/interfaces inherited from class DefaultFIDMapperFactory
DefaultFIDMapperFactory.ColumnInfo
 
Field Summary
 
Fields inherited from class DefaultFIDMapperFactory
LOGGER, returnFIDColumnsAsAttributes, returningTypedFIDMapper
 
Constructor Summary
PostgisFIDMapperFactory(JDBCDataStoreConfig config)
           
 
Method Summary
protected  FIDMapper buildLastResortFidMapper(String schema, String tableName, Connection connection, DefaultFIDMapperFactory.ColumnInfo[] colInfos)
          Builds a FidMapper when every other tentative of building one fails.
protected  FIDMapper buildNoPKMapper(String schema, String tableName, Connection connection)
          DOCUMENT ME!
protected  FIDMapper buildSingleColumnFidMapper(String schema, String tableName, Connection connection, DefaultFIDMapperFactory.ColumnInfo ci)
          Builds a FID mapper based on a single column primary key.
protected  boolean isAutoIncrement(String catalog, String schema, String tableName, Connection conn, ResultSet tableInfo, String columnName, int dataType)
          see@DefaultFIDMapperFactory in main module (jdbc) This version pre-double quotes the column name and table name and passes it to the superclass's version.
 
Methods inherited from class DefaultFIDMapperFactory
buildMultiColumnFIDMapper, getColumnInfoList, getMapper, getMapper, getPkColumnInfo, isIntegralType, isReturningTypedFIDMapper, isTextType, setReturningTypedFIDMapper
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PostgisFIDMapperFactory

public PostgisFIDMapperFactory(JDBCDataStoreConfig config)
Method Detail

buildNoPKMapper

protected FIDMapper buildNoPKMapper(String schema,
                                    String tableName,
                                    Connection connection)
Description copied from class: DefaultFIDMapperFactory
DOCUMENT ME!

Overrides:
buildNoPKMapper in class DefaultFIDMapperFactory

buildLastResortFidMapper

protected FIDMapper buildLastResortFidMapper(String schema,
                                             String tableName,
                                             Connection connection,
                                             DefaultFIDMapperFactory.ColumnInfo[] colInfos)
Description copied from class: DefaultFIDMapperFactory
Builds a FidMapper when every other tentative of building one fails. This method is used as a last resort fall back, use it if you can provide a FIDMapper that works on every kind of table, but it's usually suboptimal. The default behaviour is to return no FID mapper at all.

Overrides:
buildLastResortFidMapper in class DefaultFIDMapperFactory

buildSingleColumnFidMapper

protected FIDMapper buildSingleColumnFidMapper(String schema,
                                               String tableName,
                                               Connection connection,
                                               DefaultFIDMapperFactory.ColumnInfo ci)
Description copied from class: DefaultFIDMapperFactory
Builds a FID mapper based on a single column primary key. Default version tries the auto-increment way, then a mapping on an MaxIncFIDMapper type for numeric columns, and a plain BasicFIDMapper of text based columns.

Overrides:
buildSingleColumnFidMapper in class DefaultFIDMapperFactory
connection - an open database connection.
ci - the column information for the FID column.
Returns:
the appropriate FIDMapper.

isAutoIncrement

protected boolean isAutoIncrement(String catalog,
                                  String schema,
                                  String tableName,
                                  Connection conn,
                                  ResultSet tableInfo,
                                  String columnName,
                                  int dataType)
                           throws SQLException
see@DefaultFIDMapperFactory in main module (jdbc) This version pre-double quotes the column name and table name and passes it to the superclass's version.

Overrides:
isAutoIncrement in class DefaultFIDMapperFactory
Throws:
SQLException


Copyright © 1996-2010 Geotools. All Rights Reserved.