public interface FIDMapper extends Serializable
Basically a FIDMapper must:
Concrete instances of this class should provide support for the most common primary key mapping and generation strategis, such as pk with business meaning, serials, sequences, and so on
Classes that implement this interface should ovveride equals to provide a state based comparison.
Modifier and Type | Method and Description |
---|---|
String |
createID(Connection conn,
SimpleFeature feature,
Statement statement)
Deprecated.
Creates a new ID for a feature.
|
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.
|
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
|
String |
getID(Object[] attributes)
Deprecated.
Returns the FID given the values of the prymary key attributes
|
Object[] |
getPKAttributes(String FID)
Deprecated.
Creates the value for the PK attributes given the feature.
|
boolean |
hasAutoIncrementColumns()
Deprecated.
Returns true if at least one column is of auto-increment type
|
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(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.
Returns true it the FID generated by this mapper are volatile, that is, if asking twice for
the same Feature will not provide the same FID.
|
boolean |
returnFIDColumnsAsAttributes()
Deprecated.
If true the primary key columns will be returned as attributes.
|
void initSupportStructures()
String getID(Object[] attributes)
attributes
- DOCUMENT ME!Object[] getPKAttributes(String FID) throws IOException
FID
- The feature ID is going to be parsedIOException
String createID(Connection conn, SimpleFeature feature, Statement statement) throws IOException
conn
- - the database connectionfeature
- - the feature that needs the new FIDstatement
- - the statement used to insert the feature into the databaseIOException
boolean returnFIDColumnsAsAttributes()
int getColumnCount()
String getColumnName(int colIndex)
colIndex
- int getColumnType(int colIndex)
colIndex
- int getColumnSize(int colIndex)
colIndex
- int getColumnDecimalDigits(int colIndex)
colIndex
- boolean isAutoIncrement(int colIndex)
colIndex
- boolean hasAutoIncrementColumns()
boolean isVolatile()
This is usually true for mappers that try to generate a FID for tables without primary keys.
When this method returns true, it's up to the datastore to decide what to do, but a sane policy may be to prevent Feature writing
boolean isValid(String fid)
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.
fid
- a feature id to check for structural validitytrue
if the structure fid
indicates it is a valid feature id for the
FeatureType this FIDMapper works for, false
otherwise.Copyright © 1996–2019 Geotools. All rights reserved.