|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SQLBuilder
Provides an interface for SQL statement construction.
Currently just doing query building, but obviously this can be extended.
Method Summary | |
---|---|
String |
buildSQLQuery(String typeName,
FIDMapper mapper,
AttributeDescriptor[] attrTypes,
Filter filter)
Deprecated. use buildSQLQuery(String, FIDMapper, AttributeDescriptor[], Filter, SortBy[], Integer, Integer) |
String |
buildSQLQuery(String typeName,
FIDMapper mapper,
AttributeDescriptor[] attrTypes,
Filter filter,
SortBy[] sortBy,
Integer offset,
Integer limit)
Makes an SQL Select statement. |
void |
encode(StringBuffer sql,
Expression expression)
Lower level method allowing for the encoding of a single expession in sql |
void |
encode(StringBuffer sql,
Filter filter)
Lower level method allowing for the encoding of a single filter in sql |
Filter |
getPostQueryFilter(Filter filter)
Returns the Filter required for post processing. |
Filter |
getPreQueryFilter(Filter filter)
|
void |
setHints(Hints hints)
Hints supplied by the user. |
void |
sqlColumns(StringBuffer sql,
FIDMapper mapper,
AttributeDescriptor[] attributes)
Produces the select information required. |
void |
sqlFrom(StringBuffer sql,
String typeName)
Consutrcts FROM clause for featureType sql: FROM typeName
|
void |
sqlOrderBy(StringBuffer sql,
FIDMapper mapper,
SortBy[] sortBy)
Constructs ORDER BY clause. |
void |
sqlOrderBy(StringBuffer sql,
SortBy[] sortBy)
Deprecated. use sqlOrderBy(StringBuffer, FIDMapper, SortBy[]) |
void |
sqlWhere(StringBuffer sql,
Filter preFilter)
Constructs WHERE clause, if needed, for FILTER. |
Method Detail |
---|
void setHints(Hints hints)
The following hints are of interest when working with Features:
hints
- String buildSQLQuery(String typeName, FIDMapper mapper, AttributeDescriptor[] attrTypes, Filter filter, SortBy[] sortBy, Integer offset, Integer limit) throws SQLEncoderException
typeName
- a String with the typeName used as the table to querymapper
- an FIDMapperattrTypes
- the array of AttributeType elements for the select statementfilter
- the filter to convert to a where statementsortBy
- offset
- limit
-
SQLEncoderException
- If an error occurs encoding the SQL
FIXME: This should change to a FilterToSQLException after SQLEncoder is droppedString buildSQLQuery(String typeName, FIDMapper mapper, AttributeDescriptor[] attrTypes, Filter filter) throws SQLEncoderException
buildSQLQuery(String, FIDMapper, AttributeDescriptor[], Filter, SortBy[], Integer, Integer)
SQLEncoderException
Filter getPostQueryFilter(Filter filter)
The result will be null if no post processing is required.
This method is used by DefaultJDBCFeatureSource to see if the a Query can be optimized
filter
-
null
Filter getPreQueryFilter(Filter filter)
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.
sql
- mapper
- attributes
- void sqlFrom(StringBuffer sql, String typeName)
sql: FROM typeName
sql
- typeName
- void sqlWhere(StringBuffer sql, Filter preFilter) throws SQLEncoderException
sql: WHERE filter encoding
SQLEncoderException
void sqlOrderBy(StringBuffer sql, SortBy[] sortBy) throws SQLEncoderException
sqlOrderBy(StringBuffer, FIDMapper, SortBy[])
sql: ORDER BY <property1> [ASC|DESC], ....
SQLEncoderException
void encode(StringBuffer sql, Expression expression) throws SQLEncoderException
SQLEncoderException
void encode(StringBuffer sql, Filter filter) throws SQLEncoderException
SQLEncoderException
void sqlOrderBy(StringBuffer sql, FIDMapper mapper, SortBy[] sortBy) throws SQLEncoderException
sql: ORDER BY <property1> [ASC|DESC], ....
sql
- buffer where the complete query is being builtmapper
- where to inferr the primary key fields from in case the sortBy list contains
SortBy.NATURAL_ORDER
or SortBy.REVERSE_ORDER
sortBy
- the order by criteria, possibly null
FIXME: This should change to a FilterToSQLException after SQLEncoder is dropped
SQLEncoderException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |