|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectDefaultSQLBuilder
PostgisSQLBuilder
public class PostgisSQLBuilder
Builds sql for postgis.
modules/plugin/postgis (gt-postgis.jar)
Field Summary | |
---|---|
protected boolean |
byteaEnabled
If true, ByteA function is used to transfer WKB data |
protected JDBCDataStoreConfig |
config
the datastore |
protected boolean |
schemaEnabled
If true, tables are qualified with a schema |
protected boolean |
WKBEnabled
If true, WKB format is used instead of WKT |
Fields inherited from class DefaultSQLBuilder |
---|
accessor, encoder, ft |
Constructor Summary | |
---|---|
PostgisSQLBuilder(int srid,
JDBCDataStoreConfig config)
|
|
PostgisSQLBuilder(SQLEncoder encoder,
JDBCDataStoreConfig config)
Constructor with encoder. |
|
PostgisSQLBuilder(SQLEncoder encoder,
JDBCDataStoreConfig config,
SimpleFeatureType ft)
|
Method Summary | |
---|---|
protected void |
addOrderByPK(StringBuffer sql,
FIDMapper mapper,
SortOrder sortOrder)
Overrides to support NATURAL_ORDER and REVERSE_ORDER |
String |
buildSQLQuery(String typeName,
FIDMapper mapper,
AttributeDescriptor[] attrTypes,
Filter filter,
SortBy[] sortBy,
Integer offset,
Integer limit)
Overrides to support offset and maxFeatures |
String |
encodeColumnName(String columnName)
|
String |
encodeTableName(String tableName)
|
boolean |
isByteaEnabled()
Enables the use of the bytea function to transfer faster WKB geometries |
boolean |
isSchemaEnabled()
|
boolean |
isWKBEnabled()
Returns true if the WKB format is used to transfer geometries, false otherwise |
void |
setByteaEnabled(boolean byteaEnable)
Enables/disables the use of the bytea function |
void |
setSchemaEnabled(boolean schemaEnabled)
Enables/disables schema name qualification. |
void |
setWKBEnabled(boolean enabled)
If turned on, WKB will be used to transfer geometry data instead of WKT |
void |
sqlColumns(StringBuffer sql,
FIDMapper mapper,
AttributeDescriptor[] attributes)
Produces the select information required. |
void |
sqlFrom(StringBuffer sql,
String typeName)
Constructs FROM clause for featureType sql: FROM typeName
|
void |
sqlWhere(StringBuffer sql,
Filter preFilter)
Constructs WHERE clause, if needed, for FILTER. |
Methods inherited from class DefaultSQLBuilder |
---|
buildSQLQuery, encode, encode, getFidValidator, getPostQueryFilter, getPreQueryFilter, isForce2D, setHints, splitFilter, sqlGeometryColumn, sqlOrderBy, sqlOrderBy, sqlWhere |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean WKBEnabled
protected boolean byteaEnabled
protected boolean schemaEnabled
protected JDBCDataStoreConfig config
Constructor Detail |
---|
public PostgisSQLBuilder(int srid, JDBCDataStoreConfig config)
public PostgisSQLBuilder(SQLEncoder encoder, JDBCDataStoreConfig config)
encoder
- public PostgisSQLBuilder(SQLEncoder encoder, JDBCDataStoreConfig config, SimpleFeatureType ft)
Method Detail |
---|
public String buildSQLQuery(String typeName, FIDMapper mapper, AttributeDescriptor[] attrTypes, Filter filter, SortBy[] sortBy, Integer offset, Integer limit) throws SQLEncoderException
buildSQLQuery
in interface SQLBuilder
buildSQLQuery
in class DefaultSQLBuilder
typeName
- The name of the table (feature type) to be queriedmapper
- FIDMapper to identify the FID columns in the tableattrTypes
- The specific attribute columns to be selectedfilter
- The Filter that will be used by the encoder to construct
the WHERE clause
SQLEncoderException
- Not thrown by this method but may be thrown
by the encoder classDefaultSQLBuilder.buildSQLQuery(String, FIDMapper, AttributeDescriptor[], org.opengis.filter.Filter, SortBy[], Integer, Integer)
protected void addOrderByPK(StringBuffer sql, FIDMapper mapper, SortOrder sortOrder) throws SQLEncoderException
addOrderByPK
in class DefaultSQLBuilder
sql
- the buffer where the select statement is being built, already contains the "ORDER
BY " clause, only needs to be appended with the PK fields.mapper
- the fid mapper where to get the PK fields from, may be null, in which case
implementations should either throw an exception or not, depending on whether they
actually need it.sortOrder
- the order in which to encode the PK fields (eg,
"pkAtt1 DESC, pkAtt2 DESC"
)
SQLEncoderException
- by default, subclasses shall override if pk ordering is supportedpublic void sqlColumns(StringBuffer sql, FIDMapper mapper, AttributeDescriptor[] attributes)
The featureType, if known, is always requested.
sql: featureID (,attributeColumn)
We may need to provide AttributeReaders with a hook so they can request a wrapper function.
sqlColumns
in interface SQLBuilder
sqlColumns
in class DefaultSQLBuilder
sql
- mapper
- attributes
- public void sqlFrom(StringBuffer sql, String typeName)
sql: FROM typeName
sqlFrom
in interface SQLBuilder
sqlFrom
in class DefaultSQLBuilder
sql
- typeName
- public void sqlWhere(StringBuffer sql, Filter preFilter) throws SQLEncoderException
sql: WHERE filter encoding
sql
- DOCUMENT ME!preFilter
- DOCUMENT ME!
SQLEncoderException
- DOCUMENT ME!public boolean isWKBEnabled()
public void setWKBEnabled(boolean enabled)
enabled
- public boolean isByteaEnabled()
public void setByteaEnabled(boolean byteaEnable)
byteaEnable
- public void setSchemaEnabled(boolean schemaEnabled)
public boolean isSchemaEnabled()
public String encodeTableName(String tableName)
public String encodeColumnName(String columnName)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |