|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.data.jdbc.fidmapper.DefaultFIDMapperFactory
Default FID mapper that works with default FID mappers.
May also be used a base class for more specific and feature rich factories
Nested Class Summary | |
protected class |
DefaultFIDMapperFactory.ColumnInfo
Simple class used as a struct to hold column informations used in this factory |
Field Summary | |
protected boolean |
returnFIDColumnsAsAttributes
Set if table FID columns are to be returned as business attributes. |
Constructor Summary | |
DefaultFIDMapperFactory()
Constructs a DefaultFIDMapperFactory which will not return FID columns as business attributes. |
|
DefaultFIDMapperFactory(boolean returnFIDColumnsAsAttributes)
Constructs a DefaultFIDMapperFactory with user specification of whether to return FID columns as business attributes. |
Method Summary | |
protected FIDMapper |
buildLastResortFidMapper(java.lang.String schema,
java.lang.String tableName,
java.sql.Connection connection,
DefaultFIDMapperFactory.ColumnInfo[] colInfos)
Builds a FidMapper when every other tentative of building one fails. |
protected FIDMapper |
buildMultiColumnFIDMapper(java.lang.String schema,
java.lang.String tableName,
java.sql.Connection connection,
DefaultFIDMapperFactory.ColumnInfo[] colInfos)
Builds a FID mapper for multi column public columns |
protected FIDMapper |
buildNoPKMapper(java.lang.String schema,
java.lang.String tableName,
java.sql.Connection connection)
DOCUMENT ME! |
protected FIDMapper |
buildSingleColumnFidMapper(java.lang.String schema,
java.lang.String tableName,
java.sql.Connection connection,
DefaultFIDMapperFactory.ColumnInfo ci)
Builds a FID mapper based on a single column primary key. |
protected java.util.List |
getColumnInfoList(DefaultFIDMapperFactory.ColumnInfo[] colInfos)
Retuns a List of column infos, nice for logging the column infos leveraging the complete toString() method provided by lists |
FIDMapper |
getMapper(FeatureType featureType)
Returns a FIDMapper for the specified feature type. |
FIDMapper |
getMapper(java.lang.String catalog,
java.lang.String schema,
java.lang.String tableName,
java.sql.Connection connection)
Gets the appropriate FIDMapper for the specified table. |
protected DefaultFIDMapperFactory.ColumnInfo[] |
getPkColumnInfo(java.lang.String catalog,
java.lang.String schema,
java.lang.String typeName,
java.sql.Connection conn)
|
protected boolean |
isAutoIncrement(java.lang.String catalog,
java.lang.String schema,
java.lang.String tableName,
java.sql.Connection conn,
java.sql.ResultSet tableInfo,
java.lang.String columnName,
int dataType)
Returns true if the specified column is auto-increment. |
protected boolean |
isIntegralType(int dataType)
Returns true if the dataType for the column can serve as a primary key. |
protected boolean |
isTextType(int dataType)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected boolean returnFIDColumnsAsAttributes
Constructor Detail |
public DefaultFIDMapperFactory()
public DefaultFIDMapperFactory(boolean returnFIDColumnsAsAttributes)
returnFIDColumnsAsAttributes
- true if FID columns should be
returned as business attributes.Method Detail |
public FIDMapper getMapper(java.lang.String catalog, java.lang.String schema, java.lang.String tableName, java.sql.Connection connection) throws java.io.IOException
getMapper
in interface FIDMapperFactory
catalog
- schema
- tableName
- connection
- the active database connection to get table key
information
java.io.IOException
- if any error occurs.protected java.util.List getColumnInfoList(DefaultFIDMapperFactory.ColumnInfo[] colInfos)
colInfos
-
protected FIDMapper buildLastResortFidMapper(java.lang.String schema, java.lang.String tableName, java.sql.Connection connection, DefaultFIDMapperFactory.ColumnInfo[] colInfos)
schema
- tableName
- connection
- colInfos
-
protected FIDMapper buildSingleColumnFidMapper(java.lang.String schema, java.lang.String tableName, java.sql.Connection connection, DefaultFIDMapperFactory.ColumnInfo ci)
MaxIncFIDMapper
type for numeric columns, and a plain BasicFIDMapper
of text based columns.
schema
- tableName
- connection
- an open database connection.ci
- the column information for the FID column.
protected FIDMapper buildNoPKMapper(java.lang.String schema, java.lang.String tableName, java.sql.Connection connection)
schema
- tableName
- connection
-
protected FIDMapper buildMultiColumnFIDMapper(java.lang.String schema, java.lang.String tableName, java.sql.Connection connection, DefaultFIDMapperFactory.ColumnInfo[] colInfos)
schema
- tableName
- connection
- colInfos
-
protected DefaultFIDMapperFactory.ColumnInfo[] getPkColumnInfo(java.lang.String catalog, java.lang.String schema, java.lang.String typeName, java.sql.Connection conn) throws SchemaNotFoundException, DataSourceException
SchemaNotFoundException
DataSourceException
protected boolean isAutoIncrement(java.lang.String catalog, java.lang.String schema, java.lang.String tableName, java.sql.Connection conn, java.sql.ResultSet tableInfo, java.lang.String columnName, int dataType) throws java.sql.SQLException
catalog
- schema
- tableName
- conn
- tableInfo
- columnName
- dataType
-
java.sql.SQLException
protected boolean isIntegralType(int dataType)
dataType
- DOCUMENT ME!
protected boolean isTextType(int dataType)
public FIDMapper getMapper(FeatureType featureType)
FIDMapperFactory
getMapper
in interface FIDMapperFactory
featureType
-
FIDMapperFactory.getMapper(org.geotools.feature.FeatureType)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |