Enum Class ConversionHint

java.lang.Object
java.lang.Enum<ConversionHint>
de.calamanari.adl.sql.cnv.ConversionHint
All Implemented Interfaces:
de.calamanari.adl.Flag, Serializable, Comparable<ConversionHint>, Constable

public enum ConversionHint extends Enum<ConversionHint> implements de.calamanari.adl.Flag
Enumeration with findings that can influence SQL expression generation
Author:
Karl Eilebrecht
  • Enum Constant Details

    • NO_IS_UNKNOWN

      public static final ConversionHint NO_IS_UNKNOWN
      The expression to be converted does not contain any (negated) MatchOperator.IS_UNKNOWN

      This hint can help simplifying queries because IS UNKNOWN (SQL IS NULL) can be evil in conjunction with multi-row-sensitivity where IS UNKNOWN effectively means not any row where this field as any value. If we know that the whole query does not suffer from this problem we might create a simpler query.

    • NO_REFERENCE_MATCH

      public static final ConversionHint NO_REFERENCE_MATCH
      The expression to be converted does not compare any arguments to other arguments

      Reference matches often require extra joins if the arguments are mapped to columns of the same table and the values sit on different rows.
      Knowing that there are no reference matches in a query may lead to simpler queries.

    • NO_AND

      public static final ConversionHint NO_AND
      The expression to be converted is either an atom (e.g., color=red) or an OR of atoms (e.g., color=red OR shape=circle OR size=XXL)
    • NO_OR

      public static final ConversionHint NO_OR
      The expression to be converted is either an atom (e.g., color=red) or an AND of atoms (e.g., color=red AND shape=circle AND size=XXL)
    • NO_MULTI_ROW_SENSITIVITY

      public static final ConversionHint NO_MULTI_ROW_SENSITIVITY
      None of the involved args is sensitive to multi-row
    • NO_MULTI_ROW_REFERENCE_MATCH

      public static final ConversionHint NO_MULTI_ROW_REFERENCE_MATCH
      There is no reference match with or against a multi-row argument
    • NO_JOINS_REQUIRED

      public static final ConversionHint NO_JOINS_REQUIRED
      Derived hint: this query does not require any joins, all conditions can be applied as-is
    • LEFT_OUTER_JOINS_REQUIRED

      public static final ConversionHint LEFT_OUTER_JOINS_REQUIRED
      Derived hint: this query cannot be created with all inner joins in the main query
    • SINGLE_ATTRIBUTE

      public static final ConversionHint SINGLE_ATTRIBUTE
      The expression to be converted only deals with a single argName (attribute).

      This hint can lead to simplistic queries, e.g. if it is a simple OR of match conditions, it often does not matter if the attribute is multi-row or not.

    • SINGLE_TABLE

      public static final ConversionHint SINGLE_TABLE
      All attributes involved in the query to be converted are mapped to the same table.

      Knowing that only a single table is involved can help to write simple queries. E.g., if there are no IS UNKNOWNs involved and the related attributes are not multi-row, a simple select will do.

    • SINGLE_TABLE_CONTAINING_ALL_ROWS

      public static final ConversionHint SINGLE_TABLE_CONTAINING_ALL_ROWS
      All attributes involved in the query to be converted are mapped to the same table, and this table has all rows.

      In this case, and if there is no multi-row-sensitivity, then we can query IS NULL safely.

    • SIMPLE_CONDITION

      public static final ConversionHint SIMPLE_CONDITION
      The expression to be converted does not require any joins.

      Simple conditions can be quite complex (AND/OR) but they only deal with a single table that contains all IDs, and none of their arguments is multi-row-sensitive.

  • Method Details

    • values

      public static ConversionHint[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ConversionHint valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null