|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectJDBCFeatureWriter
JDBCTextFeatureWriter
public abstract class JDBCTextFeatureWriter
An abstract class that uses sql statements to insert, update and delete features from the database. Useful when the resultset got from the database is not updatable, for example.
Field Summary | |
---|---|
protected FIDMapper |
mapper
|
Fields inherited from class JDBCFeatureWriter |
---|
closed, current, fidAttributes, live, queryData, reader |
Constructor Summary | |
---|---|
JDBCTextFeatureWriter(FeatureReader<SimpleFeatureType,SimpleFeature> fReader,
QueryData queryData)
Creates a new instance of JDBCFeatureWriter |
Method Summary | |
---|---|
protected String |
addQuotes(Object value)
Adds quotes to an object for storage in postgis. |
protected void |
doInsert(MutableFIDFeature current)
Override that uses sql statements to perform the operation. |
protected void |
doUpdate(SimpleFeature live,
SimpleFeature current)
Override that uses sql statements to perform the operation. |
protected abstract String |
getGeometryInsertText(Geometry geom,
int srid)
Turns a geometry into the textual version needed for the sql statement |
protected String |
makeDeleteSql(SimpleFeature feature)
Generates the query for the sql delete statement |
protected String |
makeInsertSql(SimpleFeature feature)
Creates a sql insert statement. |
protected String |
makeSelectForUpdateSql(SimpleFeature current)
Generate the select for update statement, which will attempt to lock features for update. |
protected String |
makeUpdateSql(SimpleFeature live,
SimpleFeature current)
Generate the update sql statement |
void |
remove()
Override that uses sql statements to perform the operation. |
protected boolean |
useQueryDataForInsert()
This version does not use QueryData udpate/insert/remove methods, but uses separate queries instead |
Methods inherited from class JDBCFeatureWriter |
---|
close, encodeColumnName, encodeName, getFeatureType, hasNext, next, write |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected FIDMapper mapper
Constructor Detail |
---|
public JDBCTextFeatureWriter(FeatureReader<SimpleFeatureType,SimpleFeature> fReader, QueryData queryData) throws IOException
fReader
- queryData
-
IOException
Method Detail |
---|
protected void doInsert(MutableFIDFeature current) throws IOException, SQLException
doInsert
in class JDBCFeatureWriter
IOException
SQLException
JDBCFeatureWriter.doInsert(org.geotools.data.jdbc.MutableFIDFeature)
protected String makeInsertSql(SimpleFeature feature) throws IOException
feature
- the feature to add.
IOException
protected String addQuotes(Object value)
value
- The object to add quotes to.
protected abstract String getGeometryInsertText(Geometry geom, int srid) throws IOException
geom
- srid
-
IOException
public void remove() throws IOException
remove
in interface FeatureWriter<SimpleFeatureType,SimpleFeature>
remove
in class JDBCFeatureWriter
IOException
- DOCUMENT ME!FeatureWriter.remove()
protected String makeDeleteSql(SimpleFeature feature) throws IOException
feature
-
IOException
protected void doUpdate(SimpleFeature live, SimpleFeature current) throws IOException, SQLException
doUpdate
in class JDBCFeatureWriter
IOException
SQLException
org.geotools.data.jdbc.JDBCFeatureWriter#doUpdate(org.geotools.feature.Feature,
org.geotools.feature.Feature)
protected String makeSelectForUpdateSql(SimpleFeature current)
current
-
protected String makeUpdateSql(SimpleFeature live, SimpleFeature current) throws IOException
live
- current
-
IOException
protected boolean useQueryDataForInsert()
useQueryDataForInsert
in class JDBCFeatureWriter
JDBCFeatureWriter.useQueryDataForInsert()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |