|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.data.jdbc.JDBCFeatureWriter org.geotools.data.jdbc.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 |
Fields inherited from class org.geotools.data.jdbc.JDBCFeatureWriter |
closed, current, fidAttributes, listenerManager, live, queryData, reader |
Constructor Summary | |
JDBCTextFeatureWriter(FeatureReader fReader,
QueryData queryData)
Creates a new instance of JDBCFeatureWriter |
Method Summary | |
protected java.lang.String |
addQuotes(java.lang.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(Feature live,
Feature current)
Override that uses sql statements to perform the operation. |
protected java.lang.String |
encodeColumnName(java.lang.String colName)
Encodes the colName, default just calls encodeName(String) . |
protected java.lang.String |
encodeName(java.lang.String tableName)
Encodes the tableName, default is to do nothing, but postgis will override and put double quotes around the tablename. |
protected abstract java.lang.String |
getGeometryInsertText(com.vividsolutions.jts.geom.Geometry geom,
int srid)
Turns a geometry into the textual version needed for the sql statement |
protected java.lang.String |
makeDeleteSql(Feature feature)
Generates the query for the sql delete statement |
protected java.lang.String |
makeInsertSql(Feature feature)
Creates a sql insert statement. |
protected java.lang.String |
makeUpdateSql(Feature live,
Feature 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 org.geotools.data.jdbc.JDBCFeatureWriter |
close, getFeatureType, hasNext, next, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JDBCTextFeatureWriter(FeatureReader fReader, QueryData queryData) throws java.io.IOException
fReader
- queryData
-
java.io.IOException
Method Detail |
protected void doInsert(MutableFIDFeature current) throws java.io.IOException, java.sql.SQLException
doInsert
in class JDBCFeatureWriter
current
-
java.sql.SQLException
java.io.IOException
JDBCFeatureWriter.doInsert(org.geotools.data.jdbc.MutableFIDFeature)
protected java.lang.String makeInsertSql(Feature feature) throws java.io.IOException
feature
- the feature to add.
java.io.IOException
protected java.lang.String addQuotes(java.lang.Object value)
value
- The object to add quotes to.
protected java.lang.String encodeName(java.lang.String tableName)
protected java.lang.String encodeColumnName(java.lang.String colName)
encodeName(String)
.
protected abstract java.lang.String getGeometryInsertText(com.vividsolutions.jts.geom.Geometry geom, int srid) throws java.io.IOException
geom
- srid
-
java.io.IOException
public void remove() throws java.io.IOException
remove
in interface FeatureWriter
remove
in class JDBCFeatureWriter
java.io.IOException
FeatureWriter.remove()
protected java.lang.String makeDeleteSql(Feature feature) throws java.io.IOException
feature
-
java.io.IOException
protected void doUpdate(Feature live, Feature current) throws java.io.IOException, java.sql.SQLException
doUpdate
in class JDBCFeatureWriter
java.io.IOException
java.sql.SQLException
JDBCFeatureWriter.doUpdate(org.geotools.feature.Feature,
org.geotools.feature.Feature)
protected java.lang.String makeUpdateSql(Feature live, Feature current) throws java.io.IOException
live
- current
-
java.io.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 |