|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectSQLDialect
PreparedStatementSQLDialect
public abstract class PreparedStatementSQLDialect
SQL dialect which uses prepared statements for database interaction.
Field Summary |
---|
Fields inherited from class SQLDialect |
---|
BASE_DBMS_CAPABILITIES, dataStore, LOGGER |
Constructor Summary | |
---|---|
protected |
PreparedStatementSQLDialect(JDBCDataStore dataStore)
|
Method Summary | |
---|---|
PreparedFilterToSQL |
createPreparedFilterToSQL()
|
void |
onDelete(PreparedStatement delete,
Connection cx,
SimpleFeatureType featureType)
Callback invoked before a DELETE statement is executed against the database. |
void |
onInsert(PreparedStatement insert,
Connection cx,
SimpleFeatureType featureType)
Callback invoked before an INSERT statement is executed against the database. |
void |
onSelect(PreparedStatement select,
Connection cx,
SimpleFeatureType featureType)
Callback invoked before a SELECT statement is executed against the database. |
void |
onUpdate(PreparedStatement update,
Connection cx,
SimpleFeatureType featureType)
Callback invoked before an UPDATE statement is executed against the database. |
void |
prepareFunctionArgument(Class clazz,
StringBuffer sql)
Prepares a function argument for a prepared statement. |
void |
prepareGeometryValue(Geometry g,
int dimension,
int srid,
Class binding,
StringBuffer sql)
Prepares the geometry value for a prepared statement. |
abstract void |
setGeometryValue(Geometry g,
int dimension,
int srid,
Class binding,
PreparedStatement ps,
int column)
Sets the geometry value into the prepared statement. |
void |
setValue(Object value,
Class binding,
PreparedStatement ps,
int column,
Connection cx)
Sets a value in a prepared statement, for "basic types" (non-geometry). |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected PreparedStatementSQLDialect(JDBCDataStore dataStore)
Method Detail |
---|
public void prepareGeometryValue(Geometry g, int dimension, int srid, Class binding, StringBuffer sql)
This method should be overridden if the implementation needs to wrap the geometry placeholder in the function. The default implementationg just appends the default placeholder: '?'.
g
- The geometry value.srid
- The spatial reference system of the geometry, or -1 if unknowndimension
- The dimensions (2,3,4) of the coordinates, or -1 if unknownbinding
- The class of the geometry.sql
- The prepared sql statement buffer.public void prepareFunctionArgument(Class clazz, StringBuffer sql)
clazz
- The mapped class of the argument.sql
- The prepared sql statement bufferpublic abstract void setGeometryValue(Geometry g, int dimension, int srid, Class binding, PreparedStatement ps, int column) throws SQLException
g
- The geometrysrid
- the geometry native srid (should be forced into the encoded geometry)binding
- the geometry typeps
- the prepared statementcolumn
- the column index where the geometry is to be set
SQLException
public void setValue(Object value, Class binding, PreparedStatement ps, int column, Connection cx) throws SQLException
Subclasses should override this method if they need to do something custom or they wish to support non-standard types.
value
- the value.binding
- The class of the value.ps
- The prepared statement.column
- The column the value maps to.cx
- The database connection.
SQLException
public PreparedFilterToSQL createPreparedFilterToSQL()
public void onSelect(PreparedStatement select, Connection cx, SimpleFeatureType featureType) throws SQLException
The callback is provided with both the statement being executed and the database connection. Neither should be closed. Any statements created from the connection however in this method should be closed.
select
- The select statement being executedcx
- The database connectionfeatureType
- The feature type the select is executing against.
SQLException
public void onDelete(PreparedStatement delete, Connection cx, SimpleFeatureType featureType) throws SQLException
The callback is provided with both the statement being executed and the database connection. Neither should be closed. Any statements created from the connection however in this method should be closed.
delete
- The delete statement being executedcx
- The database connectionfeatureType
- The feature type the delete is executing against.
SQLException
public void onInsert(PreparedStatement insert, Connection cx, SimpleFeatureType featureType) throws SQLException
The callback is provided with both the statement being executed and the database connection. Neither should be closed. Any statements created from the connection however in this method should be closed.
insert
- The delete statement being executedcx
- The database connectionfeatureType
- The feature type the insert is executing against.
SQLException
public void onUpdate(PreparedStatement update, Connection cx, SimpleFeatureType featureType) throws SQLException
The callback is provided with both the statement being executed and the database connection. Neither should be closed. Any statements created from the connection however in this method should be closed.
update
- The delete statement being executedcx
- The database connectionfeatureType
- The feature type the update is executing against.
SQLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |