Class SpatialDatabasesSQLBuilder
- java.lang.Object
-
- com.vividsolutions.jump.datastore.spatialdatabases.SpatialDatabasesSQLBuilder
-
- Direct Known Subclasses:
H2SQLBuilder,MariadbSQLBuilder,OracleSQLBuilder,PostgisSQLBuilder,SpatialiteSQLBuilder
public class SpatialDatabasesSQLBuilder extends Object
Creates SQL query strings for a Spatial database. To be overloaded by classes implementing a spatial database support.
-
-
Field Summary
Fields Modifier and Type Field Description protected String[]colNamesprotected SpatialDatabasesDSMetadatadbMetadataprotected SpatialReferenceSystemIDdefaultSRID
-
Constructor Summary
Constructors Constructor Description SpatialDatabasesSQLBuilder(SpatialDatabasesDSMetadata dbMetadata, SpatialReferenceSystemID defaultSRID, String[] colNames)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringbuildBoxFilter(FilterQuery query)StringgetCheckSQL(DataStoreLayer dsLayer)Builds a check SQL query for the given DataStoreLayer.protected StringgetColumnListSpecifier(String[] colNames, String geomColName)Returns the string representing a SQL column definition.protected SpatialDatabasesDSMetadatagetDbMetadata()StringgetSQL(FilterQuery query)Builds a valid SQL spatial query with the given spatial filter.protected StringgetSRID(SpatialReferenceSystemID querySRID)
-
-
-
Field Detail
-
defaultSRID
protected SpatialReferenceSystemID defaultSRID
-
colNames
protected String[] colNames
-
dbMetadata
protected SpatialDatabasesDSMetadata dbMetadata
-
-
Constructor Detail
-
SpatialDatabasesSQLBuilder
public SpatialDatabasesSQLBuilder(SpatialDatabasesDSMetadata dbMetadata, SpatialReferenceSystemID defaultSRID, String[] colNames)
-
-
Method Detail
-
getSQL
public String getSQL(FilterQuery query)
Builds a valid SQL spatial query with the given spatial filter.- Parameters:
query- the filter query- Returns:
- a SQL query to get column names
-
getCheckSQL
public String getCheckSQL(DataStoreLayer dsLayer)
Builds a check SQL query for the given DataStoreLayer.- Parameters:
dsLayer- the @link DataStoreLayer to test- Returns:
- a SQL query forced to limit 0 to test the layer source
-
getColumnListSpecifier
protected String getColumnListSpecifier(String[] colNames, String geomColName)
Returns the string representing a SQL column definition. Implementors should take care of column names (case, quotes)- Parameters:
colNames- list of column namesgeomColName- name of the geometry column- Returns:
- column list
-
getDbMetadata
protected SpatialDatabasesDSMetadata getDbMetadata()
-
buildBoxFilter
protected String buildBoxFilter(FilterQuery query)
-
getSRID
protected String getSRID(SpatialReferenceSystemID querySRID)
-
-