org.geotools.data.jdbc.fidmapper
Class NullFIDMapper

java.lang.Object
  extended by org.geotools.data.jdbc.fidmapper.AbstractFIDMapper
      extended by org.geotools.data.jdbc.fidmapper.NullFIDMapper
All Implemented Interfaces:
java.io.Serializable, FIDMapper

Deprecated. scheduled for removal in 2.7, use classes in org.geotools.jdbc

public class NullFIDMapper
extends AbstractFIDMapper

Last resort fid mapper for tables that does not have a primary key. It allows reading the table getting unique FIDs by using the same mechanism used by DefaultFeature, but the same Feature will receive a different FID each time it is loaded from the datastore.

Author:
wolf
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.geotools.data.jdbc.fidmapper.AbstractFIDMapper
autoIncrement, colDecimalDigits, colNames, colSizes, colTypes, returnFIDColumnsAsAttributes, tableName, tableSchemaName
 
Constructor Summary
NullFIDMapper()
          Deprecated.  
NullFIDMapper(java.lang.String tableSchemaName, java.lang.String tableName)
          Deprecated. Constructor to set schema and table name for Null mapper.
 
Method Summary
 java.lang.String createID(java.sql.Connection conn, org.opengis.feature.simple.SimpleFeature feature, java.sql.Statement statement)
          Deprecated. Creates a new ID for a feature.
 java.lang.String getID(java.lang.Object[] attributes)
          Deprecated. Returns the FID given the values of the prymary key attributes
 java.lang.Object[] getPKAttributes(java.lang.String FID)
          Deprecated. Creates the value for the PK attributes given the feature.
 boolean isValid(java.lang.String fid)
          Deprecated. Provides a simple means of assessing if a feature id is structurally valid with respect to the fids this FIDMapper creates.
 boolean isVolatile()
          Deprecated. This FID mappers generates unique IDs out of the blue using UID
 
Methods inherited from class org.geotools.data.jdbc.fidmapper.AbstractFIDMapper
getColumnCount, getColumnDecimalDigits, getColumnDecimalDigits, getColumnName, getColumnName, getColumnSize, getColumnSize, getColumnType, getColumnType, getTableName, getTableSchemaName, hasAutoIncrementColumns, initSupportStructures, isAutoIncrement, isAutoIncrement, returnFIDColumnsAsAttributes, setInfo, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NullFIDMapper

public NullFIDMapper()
Deprecated. 

NullFIDMapper

public NullFIDMapper(java.lang.String tableSchemaName,
                     java.lang.String tableName)
Deprecated. 
Constructor to set schema and table name for Null mapper.

Parameters:
tableSchemaName -
tableName -
Method Detail

getID

public java.lang.String getID(java.lang.Object[] attributes)
Deprecated. 
Description copied from interface: FIDMapper
Returns the FID given the values of the prymary key attributes

Parameters:
attributes - DOCUMENT ME!
See Also:
FIDMapper.getID(java.lang.Object[])

getPKAttributes

public java.lang.Object[] getPKAttributes(java.lang.String FID)
                                   throws java.io.IOException
Deprecated. 
Description copied from interface: FIDMapper
Creates the value for the PK attributes given the feature. If the FID is null, will throw an IOException if not possible. If null is returned, no primary key value needs to be specified, which is what we want for auto-increment fields.

Parameters:
FID - The feature ID is going to be parsed
Throws:
java.io.IOException
See Also:
FIDMapper.getPKAttributes(java.lang.String)

createID

public java.lang.String createID(java.sql.Connection conn,
                                 org.opengis.feature.simple.SimpleFeature feature,
                                 java.sql.Statement statement)
                          throws java.io.IOException
Deprecated. 
Description copied from interface: FIDMapper
Creates a new ID for a feature.
This is done either by querying the database (for auto-increment like types, for example sequences) or by inspecting the Feature (for example, for primary keys with business meaning that whose attributes are included in the Feature ones).

Parameters:
conn - - the database connection
feature - - the feature that needs the new FID
statement - - the statement used to insert the feature into the database
Throws:
java.io.IOException
See Also:
org.geotools.data.jdbc.fidmapper.FIDMapper#createID(java.sql.Connection, org.geotools.feature.Feature, Statement)

isVolatile

public boolean isVolatile()
Deprecated. 
This FID mappers generates unique IDs out of the blue using UID

Specified by:
isVolatile in interface FIDMapper
Overrides:
isVolatile in class AbstractFIDMapper
See Also:
FIDMapper.isVolatile()

isValid

public boolean isValid(java.lang.String fid)
Deprecated. 
Description copied from interface: FIDMapper
Provides a simple means of assessing if a feature id is structurally valid with respect to the fids this FIDMapper creates.

The primary purpose of this method is to help in filtering out fids from filters that are not appropriate for a given FeatureType but that may otherwise being treated as valid if they get down to the actual SQL query.

The validity check may be as strict or as loose as the concrete FIDMapper wishes, since there may be cases where whether a fid in a filter is valid or not is not that important, or where it may result in deleting a Feature that was not expected to be deleted.

An example of such a need for validation may be a feature id composed like <featureTypeName>.<number>, where the actual table PK is just the <number> part. If a request over the FeatureType "ft1" is made with a fid filter like ft2.1, this method can ensure the number 1 is not send out in the SQL query at all.

Parameters:
fid - a feature id to check for structural validity
Returns:
true always
See Also:
FIDMapper.isValid(String)


Copyright © 1996-2010 Geotools. All Rights Reserved.