org.geotools.data.jdbc.fidmapper
Class TypedFIDMapper

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

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

public class TypedFIDMapper
extends AbstractFIDMapper

This fidmapper just takes another fid mapper and builds fids based on the wrapped FIDMapper by prefixing them with the feature type name, that is, the resulting fid follow the <featureTypeName>.<basic_fid> pattern.

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
TypedFIDMapper(FIDMapper wrapped, java.lang.String featureTypeName)
          Deprecated. Creates a new TypedFIDMapper object.
 
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.
 boolean equals(java.lang.Object object)
          Deprecated.  
 int getColumnCount()
          Deprecated. Returns the number of columns in the primary keys handled by this mapper
 int getColumnDecimalDigits(int colIndex)
          Deprecated. Provides the number of decimal digits for this column.
 java.lang.String getColumnName(int colIndex)
          Deprecated. Returns the name of the specified column in the primary key
 int getColumnSize(int colIndex)
          Deprecated. Returns the size of a primary key column as it would be provided by the database metadata.
 int getColumnType(int colIndex)
          Deprecated. Returns the column type by using a constant available in the java.sql.Types interface
 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.
 java.lang.String getTableName()
          Deprecated.  
 java.lang.String getTableSchemaName()
          Deprecated.  
 FIDMapper getWrappedMapper()
          Deprecated. Returns the base mapper wrapped by this TypedFIDMapper
 void initSupportStructures()
          Deprecated. This method will be called by JDBCDataStore when creating new tables to give the FID mapper an opportunity to initialize needed data structures, such as support tables, sequences, and so on.
 boolean isAutoIncrement(int colIndex)
          Deprecated. Returns true if the column is of serial type, that is, its value is automatically generated by the database if the user does not provide one
 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. Convenience since most FID mappers should be persistent, override on the specific ones that aren't.
 boolean returnFIDColumnsAsAttributes()
          Deprecated. If true the primary key columns will be returned as attributes.
 java.lang.String toString()
          Deprecated. Create a nice string representation of a FID Mapper
 
Methods inherited from class org.geotools.data.jdbc.fidmapper.AbstractFIDMapper
getColumnDecimalDigits, getColumnName, getColumnSize, getColumnType, hasAutoIncrementColumns, isAutoIncrement, setInfo
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TypedFIDMapper

public TypedFIDMapper(FIDMapper wrapped,
                      java.lang.String featureTypeName)
Deprecated. 
Creates a new TypedFIDMapper object.

Parameters:
wrapped -
featureTypeName -
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!
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)

returnFIDColumnsAsAttributes

public boolean returnFIDColumnsAsAttributes()
Deprecated. 
Description copied from interface: FIDMapper
If true the primary key columns will be returned as attributes. This is fundamental for primary key with businnes meaning.

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

getColumnCount

public int getColumnCount()
Deprecated. 
Description copied from interface: FIDMapper
Returns the number of columns in the primary keys handled by this mapper

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

getColumnName

public java.lang.String getColumnName(int colIndex)
Deprecated. 
Description copied from interface: FIDMapper
Returns the name of the specified column in the primary key

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

getColumnType

public int getColumnType(int colIndex)
Deprecated. 
Description copied from interface: FIDMapper
Returns the column type by using a constant available in the java.sql.Types interface

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

getColumnSize

public int getColumnSize(int colIndex)
Deprecated. 
Description copied from interface: FIDMapper
Returns the size of a primary key column as it would be provided by the database metadata. Some fields requires a size specification, such as VARCHAR or NUMBER, whilst other don't have or don't need it (for example, an INTEGER or a TEXT field).

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

getColumnDecimalDigits

public int getColumnDecimalDigits(int colIndex)
Deprecated. 
Description copied from interface: FIDMapper
Provides the number of decimal digits for this column. This is relevant in particular when the column is a scaled integer such as a NUMBER column

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

isAutoIncrement

public boolean isAutoIncrement(int colIndex)
Deprecated. 
Description copied from interface: FIDMapper
Returns true if the column is of serial type, that is, its value is automatically generated by the database if the user does not provide one

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

equals

public boolean equals(java.lang.Object object)
Deprecated. 
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

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)

initSupportStructures

public void initSupportStructures()
Deprecated. 
Description copied from interface: FIDMapper
This method will be called by JDBCDataStore when creating new tables to give the FID mapper an opportunity to initialize needed data structures, such as support tables, sequences, and so on.

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

getWrappedMapper

public FIDMapper getWrappedMapper()
Deprecated. 
Returns the base mapper wrapped by this TypedFIDMapper


toString

public java.lang.String toString()
Deprecated. 
Description copied from class: AbstractFIDMapper
Create a nice string representation of a FID Mapper

Overrides:
toString in class AbstractFIDMapper
Returns:
the String representation

getTableName

public java.lang.String getTableName()
Deprecated. 
Overrides:
getTableName in class AbstractFIDMapper

getTableSchemaName

public java.lang.String getTableSchemaName()
Deprecated. 
Overrides:
getTableSchemaName in class AbstractFIDMapper

isVolatile

public boolean isVolatile()
Deprecated. 
Description copied from class: AbstractFIDMapper
Convenience since most FID mappers should be persistent, override on the specific ones that aren't.

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 if the structure fid indicates it is a valid feature id for the FeatureType this FIDMapper works for, false otherwise.
See Also:
FIDMapper.isValid(String)


Copyright © 1996-2010 Geotools. All Rights Reserved.