|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The FIDMapper interface manages the mapping of feature id to the identifiers provided in a database.
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.
Method Summary | |
java.lang.String |
createID(java.sql.Connection conn,
Feature feature,
java.sql.Statement statement)
Creates a new ID for a feature. |
int |
getColumnCount()
Returns the number of columns in the primary keys handled by this mapper |
int |
getColumnDecimalDigits(int colIndex)
Provides the number of decimal digits for this column. |
java.lang.String |
getColumnName(int colIndex)
Returns the name of the specified column in the primary key |
int |
getColumnSize(int colIndex)
Returns the size of a primary key column as it would be provided by the database metadata. |
int |
getColumnType(int colIndex)
Returns the column type by using a constant available in the java.sql.Types interface |
java.lang.String |
getID(java.lang.Object[] attributes)
Returns the FID given the values of the prymary key attributes |
java.lang.Object[] |
getPKAttributes(java.lang.String FID)
Creates the value for the PK attributes given the feature. |
boolean |
hasAutoIncrementColumns()
Returns true if at least one column is of auto-increment type |
void |
initSupportStructures()
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)
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 |
isVolatile()
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()
If true the primary key columns will be returned as attributes. |
Method Detail |
public void initSupportStructures()
public java.lang.String getID(java.lang.Object[] attributes)
attributes
- DOCUMENT ME!
public java.lang.Object[] getPKAttributes(java.lang.String FID) throws java.io.IOException
FID
- The feature ID is going to be parsed
java.io.IOException
public java.lang.String createID(java.sql.Connection conn, Feature feature, java.sql.Statement statement) throws java.io.IOException
conn
- - the database connectionfeature
- - the feature that needs the new FIDstatement
- - the statement used to insert the feature into the
database
java.io.IOException
public boolean returnFIDColumnsAsAttributes()
public int getColumnCount()
public java.lang.String getColumnName(int colIndex)
colIndex
-
public int getColumnType(int colIndex)
colIndex
-
public int getColumnSize(int colIndex)
colIndex
-
public int getColumnDecimalDigits(int colIndex)
colIndex
-
public boolean isAutoIncrement(int colIndex)
colIndex
-
public boolean hasAutoIncrementColumns()
public 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
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |