Package nl.b3p.jdbc.util.converter
Class GeometryJdbcConverter
- java.lang.Object
-
- nl.b3p.jdbc.util.converter.GeometryJdbcConverter
-
- Direct Known Subclasses:
HSQLJdbcConverter,MssqlJdbcConverter,OracleJdbcConverter,PostgisJdbcConverter
public abstract class GeometryJdbcConverter extends Object
- Author:
- Matthijs Laan, Meine Toonen, mprins
-
-
Constructor Summary
Constructors Constructor Description GeometryJdbcConverter()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract StringBuilderbuildLimitSql(StringBuilder sql, int limit)abstract StringbuildPaginationSql(String sql, int offset, int limit)abstract org.locationtech.jts.geom.GeometryconvertToJTSGeometryObject(Object nativeObj)ObjectconvertToNativeGeometryObject(String param)abstract ObjectconvertToNativeGeometryObject(org.locationtech.jts.geom.Geometry param)abstract ObjectconvertToNativeGeometryObject(org.locationtech.jts.geom.Geometry param, int srid)static ObjectconvertToSQLObject(String stringValue, ColumnMetadata cm, String tableName, String column)ObjectcreateNativePoint(double lat, double lon, int srid)StringcreatePSGeometryPlaceholder()abstract StringgetGeomTypeName()abstract StringgetGeotoolsDBTypeName()abstract StringgetMViewRefreshSQL(String mview)abstract StringgetMViewsSQL()abstract StringgetSchema()abstract 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 aPreparedStatementto restart a sequence.abstract booleanisDuplicateKeyViolationMessage(String message)abstract booleanisFKConstraintViolationMessage(String message)bepaal of een melding een constraint violation betreft.abstract booleanisPmdKnownBroken()abstract booleanuseSavepoints()
-
-
-
Method Detail
-
convertToSQLObject
public static Object convertToSQLObject(String stringValue, ColumnMetadata cm, String tableName, String column)
-
convertToNativeGeometryObject
public abstract Object convertToNativeGeometryObject(org.locationtech.jts.geom.Geometry param) throws SQLException, org.locationtech.jts.io.ParseException
- Throws:
SQLExceptionorg.locationtech.jts.io.ParseException
-
convertToNativeGeometryObject
public abstract Object convertToNativeGeometryObject(org.locationtech.jts.geom.Geometry param, int srid) throws SQLException, org.locationtech.jts.io.ParseException
- Throws:
SQLExceptionorg.locationtech.jts.io.ParseException
-
convertToJTSGeometryObject
public abstract org.locationtech.jts.geom.Geometry convertToJTSGeometryObject(Object nativeObj)
-
createPSGeometryPlaceholder
public String createPSGeometryPlaceholder() throws SQLException
- Throws:
SQLException
-
getSchema
public abstract String getSchema()
-
getGeomTypeName
public abstract String getGeomTypeName()
-
isDuplicateKeyViolationMessage
public abstract boolean isDuplicateKeyViolationMessage(String message)
-
isFKConstraintViolationMessage
public abstract boolean isFKConstraintViolationMessage(String message)
bepaal of een melding een constraint violation betreft.- Parameters:
message- de melding uit de database- Returns:
trueals de melding een contraint violation betreft
-
buildLimitSql
public abstract StringBuilder buildLimitSql(StringBuilder sql, int limit)
-
useSavepoints
public abstract boolean useSavepoints()
-
isPmdKnownBroken
public abstract boolean isPmdKnownBroken()
-
getMViewsSQL
public abstract String getMViewsSQL()
-
getUpdateSequenceSQL
public String getUpdateSequenceSQL(String seqName, long nextVal)
Gets a statement to use in aPreparedStatementto restart a sequence.- 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
-
getSelectNextValueFromSequenceSQL
public abstract String getSelectNextValueFromSequenceSQL(String seqName)
get the database flavour specific SQL statement to get the next value from a sequence.- Parameters:
seqName- name of sequence- Returns:
- SQL statement specific for the flavour of database
-
getGeotoolsDBTypeName
public abstract String getGeotoolsDBTypeName()
-
convertToNativeGeometryObject
public Object convertToNativeGeometryObject(String param) throws org.locationtech.jts.io.ParseException, SQLException
- Throws:
org.locationtech.jts.io.ParseExceptionSQLException
-
createNativePoint
public Object createNativePoint(double lat, double lon, int srid) throws SQLException, org.locationtech.jts.io.ParseException
- Throws:
SQLExceptionorg.locationtech.jts.io.ParseException
-
-