Class SelectionClause


public final class SelectionClause extends SQLBuilder
Builder for the SQL fragment on the right side of the WHERE keyword.
Since:
1.1
Version:
1.1
  • Field Details

    • table

      private final Table table
      The table or view for which to create a SQL statement.
    • isInvalid

      boolean isInvalid
      Flag sets to true 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

      final void appendColumnName(ValueReference<AbstractFeature,?> ref)
      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

      final void appendLiteral(Object value)
      Writes a literal value, or marks this SQL as invalid if the value cannot be formatted.
    • appendGeometry

      private void appendGeometry(GeometryWrapper<?> wrapper, org.opengis.geometry.Envelope bounds)
      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

      final boolean tryAppend(SelectionClauseWriter writer, Filter<? super AbstractFeature> filter)
      Tries to append a SQL statement for the given filter. This method returns true on success, or false if the statement can no be written. In the latter case, the content of this SelectionClause 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, or false in this SelectionClause is unchanged.