Record Class CoreExpressionStats

java.lang.Object
java.lang.Record
de.calamanari.adl.sql.cnv.CoreExpressionStats
Record Components:
hints - see ConversionHint
argNames - all the arguments involved in a given expression
argNamesMarkedMultiRow - arguments in the expression that are directly or indirectly (sparse table) marked as multi-row
argNamesWithMultiRowSensitivity - arguments with multi-row characteristics relevant to the expression
argNamesInPositiveValueMatches - arguments that occur in matches against values
argNamesInNegativeValueMatches - arguments that occur in negated matches against values
argNamesInPositiveIsUnknownMatches - arguments that occur in IS UNKNOWN matches
argNamesInNegativeIsUnknownMatches - aruments that occur in negated IS UNKNOWN matches
requiredTables - list of all tables referenced by arguments in the expression
isSeparateBaseTableRequired - true if an extra table is required to cover all IDs and the query cannot be based on a union of all related tables

public record CoreExpressionStats(Set<de.calamanari.adl.Flag> hints, Set<String> argNames, Set<String> argNamesMarkedMultiRow, Set<String> argNamesWithMultiRowSensitivity, Set<String> argNamesInPositiveValueMatches, Set<String> argNamesInNegativeValueMatches, Set<String> argNamesInPositiveIsUnknownMatches, Set<String> argNamesInNegativeIsUnknownMatches, Set<String> requiredTables, boolean isSeparateBaseTableRequired) extends Record
CoreExpressionStats is a report with meta information about an expression to be converted.

The provided statistics later influence the way how the expression can be translated into a rather simplistic or complex SQL-expression.

The members (sets) of this record are all mutable to allow refinement.

Author:
Karl Eilebrecht
  • Constructor Details

  • Method Details

    • from

      public static CoreExpressionStats from(de.calamanari.adl.irl.CoreExpression expression, DataBinding dataBinding, de.calamanari.adl.ProcessContext ctx)
      Analyzes the given root expression considering the configured data binding and returns statistics to be used during expression to SQL conversion.
      Parameters:
      expression -
      dataBinding -
      ctx -
      Returns:
      statistics
    • isMultiRowSensitive

      public boolean isMultiRowSensitive(String argName)
      Parameters:
      argName -
      Returns:
      true if the given argument is explicitly or implicitly sensitive to multi-row scenarios
    • hasAnyMultiRowSensitiveArgs

      public boolean hasAnyMultiRowSensitiveArgs()
      Returns:
      true if there are any multi-row sensitive arguments in the current query
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • hints

      public Set<de.calamanari.adl.Flag> hints()
      Returns the value of the hints record component.
      Returns:
      the value of the hints record component
    • argNames

      public Set<String> argNames()
      Returns the value of the argNames record component.
      Returns:
      the value of the argNames record component
    • argNamesMarkedMultiRow

      public Set<String> argNamesMarkedMultiRow()
      Returns the value of the argNamesMarkedMultiRow record component.
      Returns:
      the value of the argNamesMarkedMultiRow record component
    • argNamesWithMultiRowSensitivity

      public Set<String> argNamesWithMultiRowSensitivity()
      Returns the value of the argNamesWithMultiRowSensitivity record component.
      Returns:
      the value of the argNamesWithMultiRowSensitivity record component
    • argNamesInPositiveValueMatches

      public Set<String> argNamesInPositiveValueMatches()
      Returns the value of the argNamesInPositiveValueMatches record component.
      Returns:
      the value of the argNamesInPositiveValueMatches record component
    • argNamesInNegativeValueMatches

      public Set<String> argNamesInNegativeValueMatches()
      Returns the value of the argNamesInNegativeValueMatches record component.
      Returns:
      the value of the argNamesInNegativeValueMatches record component
    • argNamesInPositiveIsUnknownMatches

      public Set<String> argNamesInPositiveIsUnknownMatches()
      Returns the value of the argNamesInPositiveIsUnknownMatches record component.
      Returns:
      the value of the argNamesInPositiveIsUnknownMatches record component
    • argNamesInNegativeIsUnknownMatches

      public Set<String> argNamesInNegativeIsUnknownMatches()
      Returns the value of the argNamesInNegativeIsUnknownMatches record component.
      Returns:
      the value of the argNamesInNegativeIsUnknownMatches record component
    • requiredTables

      public Set<String> requiredTables()
      Returns the value of the requiredTables record component.
      Returns:
      the value of the requiredTables record component
    • isSeparateBaseTableRequired

      public boolean isSeparateBaseTableRequired()
      Returns the value of the isSeparateBaseTableRequired record component.
      Returns:
      the value of the isSeparateBaseTableRequired record component