- java.lang.Object
-
- nl.b3p.jdbc.util.converter.GeometryJdbcConverter
-
- nl.b3p.jdbc.util.converter.OracleJdbcConverter
-
- Direct Known Subclasses:
Oracle11JdbcConverter,Oracle12JdbcConverter
public class OracleJdbcConverter extends GeometryJdbcConverter
- Author:
- Matthijs Laan
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.apache.commons.logging.LogLOG-
Fields inherited from class nl.b3p.jdbc.util.converter.GeometryJdbcConverter
gf, wkt
-
-
Constructor Summary
Constructors Constructor Description OracleJdbcConverter(oracle.jdbc.OracleConnection oc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringBuilderbuildLimitSql(StringBuilder sql, int limit)Voegt een limiet toe aan een query te gebruiken in geval van insert met select.StringbuildPaginationSql(String sql, int offset, int limit)org.locationtech.jts.geom.GeometryconvertToJTSGeometryObject(Object nativeObj)de geotools converter is niet round-trip safe, er treed een NPE op als een 'lege' geometrie wordt aangeboden:ObjectconvertToNativeGeometryObject(org.locationtech.jts.geom.Geometry g)ObjectconvertToNativeGeometryObject(org.locationtech.jts.geom.Geometry g, int srid)StringgetGeomTypeName()StringgetGeotoolsDBTypeName()StringgetMViewRefreshSQL(String mview)StringgetMViewsSQL()StringgetSchema()StringgetSelectNextValueFromSequenceSQL(String seqName)get the database flavour specific SQL statement to get the next value from a sequence.StringgetUpdateSequenceSQL(String seqName, long nextVal)Gets a statement to use in a prepared statement to restart a sequence.booleanisDuplicateKeyViolationMessage(String message)booleanisFKConstraintViolationMessage(String message)bepaal of een melding een constraint violation betreft.booleanisPmdKnownBroken()voidsetSchema(String schema)booleanuseSavepoints()-
Methods inherited from class nl.b3p.jdbc.util.converter.GeometryJdbcConverter
convertToNativeGeometryObject, convertToSQLObject, createNativePoint, createPSGeometryPlaceholder
-
-
-
-
Constructor Detail
-
OracleJdbcConverter
public OracleJdbcConverter(oracle.jdbc.OracleConnection oc) throws SQLException- Throws:
SQLException
-
-
Method Detail
-
isDuplicateKeyViolationMessage
public boolean isDuplicateKeyViolationMessage(String message)
- Specified by:
isDuplicateKeyViolationMessagein classGeometryJdbcConverter
-
isFKConstraintViolationMessage
public boolean isFKConstraintViolationMessage(String message)
Description copied from class:GeometryJdbcConverterbepaal of een melding een constraint violation betreft.- Specified by:
isFKConstraintViolationMessagein classGeometryJdbcConverter- Parameters:
message- de melding uit de database- Returns:
trueals de melding een contraint violation betreft
-
convertToNativeGeometryObject
public Object convertToNativeGeometryObject(org.locationtech.jts.geom.Geometry g, int srid) throws SQLException
- Specified by:
convertToNativeGeometryObjectin classGeometryJdbcConverter- Throws:
SQLException
-
convertToNativeGeometryObject
public Object convertToNativeGeometryObject(org.locationtech.jts.geom.Geometry g) throws SQLException, org.locationtech.jts.io.ParseException
- Specified by:
convertToNativeGeometryObjectin classGeometryJdbcConverter- Throws:
SQLExceptionorg.locationtech.jts.io.ParseException
-
getSchema
public String getSchema()
- Specified by:
getSchemain classGeometryJdbcConverter- Returns:
- the schema
-
setSchema
public void setSchema(String schema)
- Parameters:
schema- the schema to set
-
getGeomTypeName
public String getGeomTypeName()
- Specified by:
getGeomTypeNamein classGeometryJdbcConverter
-
buildPaginationSql
public String buildPaginationSql(String sql, int offset, int limit)
- Specified by:
buildPaginationSqlin classGeometryJdbcConverter
-
buildLimitSql
public StringBuilder buildLimitSql(StringBuilder sql, int limit)
Voegt een limiet toe aan een query te gebruiken in geval van insert met select. Bijvoorbeeld zoals het plaatsen van stand-berichten in de job tabel. NBbuildPaginationSql(java.lang.String, int, int)is niet bruikbaar voor een insert+select- Specified by:
buildLimitSqlin classGeometryJdbcConverter- Parameters:
sql- query zonder limietlimit- max aantal op te halen records dat voldoet aan query- Returns:
- query met limiet
- Since:
- 1.4.1
-
useSavepoints
public boolean useSavepoints()
- Specified by:
useSavepointsin classGeometryJdbcConverter
-
isPmdKnownBroken
public boolean isPmdKnownBroken()
- Specified by:
isPmdKnownBrokenin classGeometryJdbcConverter
-
getGeotoolsDBTypeName
public String getGeotoolsDBTypeName()
- Specified by:
getGeotoolsDBTypeNamein classGeometryJdbcConverter
-
getMViewsSQL
public String getMViewsSQL()
- Specified by:
getMViewsSQLin classGeometryJdbcConverter
-
getMViewRefreshSQL
public String getMViewRefreshSQL(String mview)
- Specified by:
getMViewRefreshSQLin classGeometryJdbcConverter
-
getSelectNextValueFromSequenceSQL
public String getSelectNextValueFromSequenceSQL(String seqName)
Description copied from class:GeometryJdbcConverterget the database flavour specific SQL statement to get the next value from a sequence.- Specified by:
getSelectNextValueFromSequenceSQLin classGeometryJdbcConverter- Parameters:
seqName- name of sequence- Returns:
- SQL statement specific for the flavour of database
-
convertToJTSGeometryObject
public org.locationtech.jts.geom.Geometry convertToJTSGeometryObject(Object nativeObj)
de geotools converter is niet round-trip safe, er treed een NPE op als een 'lege' geometrie wordt aangeboden:at org.geotools.data.oracle.sdo.SDO.ETYPE(SDO.java:1681) at org.geotools.data.oracle.sdo.SDO.create(SDO.java:1933) at org.geotools.data.oracle.sdo.GeometryConverter.asGeometry(GeometryConverter.java:121)dat is een bug in geotools.- Specified by:
convertToJTSGeometryObjectin classGeometryJdbcConverter- Parameters:
nativeObj- uit de database- Returns:
- jts geom of
null
-
getUpdateSequenceSQL
public String getUpdateSequenceSQL(String seqName, long nextVal)
Gets a statement to use in a prepared statement to restart a sequence. This assumes no other interactions are going on with the sequence; can only be used to increase the value of the sequence, not decrease.- Overrides:
getUpdateSequenceSQLin classGeometryJdbcConverter- Parameters:
seqName- name of sequencenextVal- the value to restart the sequence, some systems require this to be larger than the next value of the sequence.- Returns:
- SQL statement specific for the flavour of database
-
-