Class SelectionClause
java.lang.Object
org.apache.sis.internal.metadata.sql.Syntax
org.apache.sis.internal.metadata.sql.SQLBuilder
org.apache.sis.internal.sql.feature.SelectionClause
Builder for the SQL fragment on the right side of the
WHERE
keyword.- Since:
- 1.1
- Version:
- 1.1
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) boolean
Flag sets totrue
if a filter or expression cannot be converted to SQL.private final Table
The table or view for which to create a SQL statement.Fields inherited from class org.apache.sis.internal.metadata.sql.SQLBuilder
buffer, SELECT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) final void
Writes the name of a column, or marks the SQL as invalid if the column is not found.private void
appendGeometry
(GeometryWrapper<?> wrapper, org.opengis.geometry.Envelope bounds) Appends the given geometry in Well-Known Text (WKT) format.(package private) final void
appendLiteral
(Object value) Writes a literal value, or marks this SQL as invalid if the value cannot be formatted.private static double
clampInfinity
(double value) Replaces infinity values by the maximal real number.(package private) final void
Declares the SQL as invalid.(package private) final boolean
tryAppend
(SelectionClauseWriter writer, Filter<? super AbstractFeature> filter) Tries to append a SQL statement for the given filter.Methods inherited from class org.apache.sis.internal.metadata.sql.SQLBuilder
append, append, append, append, appendEqualsValue, appendFetchPage, appendIdentifier, appendIdentifier, appendIdentifier, appendValue, appendValue, appendWildcardEscaped, clear, createColumn, createForeignKey, insertDistinctAfterSelect, isEmpty, toString
-
Field Details
-
table
The table or view for which to create a SQL statement. -
isInvalid
boolean isInvalidFlag sets totrue
if a filter or expression cannot be converted to SQL. When a SQL string become flagged as invalid, it is truncated to the length that it had the last time that it was valid.- See Also:
-
-
Constructor Details
-
SelectionClause
SelectionClause(Table table) Creates a new builder for the given table.- Parameters:
table
- the table or view for which to create a SQL statement.
-
-
Method Details
-
appendColumnName
Writes the name of a column, or marks the SQL as invalid if the column is not found.- Parameters:
ref
- reference to a property to insert in SQL statement.
-
appendLiteral
Writes a literal value, or marks this SQL as invalid if the value cannot be formatted. -
appendGeometry
Appends the given geometry in Well-Known Text (WKT) format. Exactly one of the given argument should be non-null. If both arguments are null, the SQL is declared invalid. -
clampInfinity
private static double clampInfinity(double value) Replaces infinity values by the maximal real number. -
invalidate
final void invalidate()Declares the SQL as invalid. It does not means that the whole SQL needs to be discarded. The SQL may be truncated to the last point where it was considered valid. -
tryAppend
Tries to append a SQL statement for the given filter. This method returnstrue
on success, orfalse
if the statement can no be written. In the latter case, the content of thisSelectionClause
is unchanged.- Parameters:
writer
- the visitor to use for converting filters to SQL statements.filter
- the filter to try to convert to SQL statements.- Returns:
true
on success, orfalse
in thisSelectionClause
is unchanged.
-