Record Class CoreExpressionStats
java.lang.Object
java.lang.Record
de.calamanari.adl.sql.cnv.CoreExpressionStats
- Record Components:
hints- seeConversionHintargNames- all the arguments involved in a given expressionargNamesMarkedMultiRow- arguments in the expression that are directly or indirectly (sparse table) marked as multi-rowargNamesWithMultiRowSensitivity- arguments with multi-row characteristics relevant to the expressionargNamesInPositiveValueMatches- arguments that occur in matches against valuesargNamesInNegativeValueMatches- arguments that occur in negated matches against valuesargNamesInPositiveIsUnknownMatches- arguments that occur in IS UNKNOWN matchesargNamesInNegativeIsUnknownMatches- aruments that occur in negated IS UNKNOWN matchesrequiredTables- list of all tables referenced by arguments in the expressionisSeparateBaseTableRequired- 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 Summary
ConstructorsConstructorDescriptionCoreExpressionStats(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) Creates an instance of aCoreExpressionStatsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionargNames()Returns the value of theargNamesrecord component.Returns the value of theargNamesInNegativeIsUnknownMatchesrecord component.Returns the value of theargNamesInNegativeValueMatchesrecord component.Returns the value of theargNamesInPositiveIsUnknownMatchesrecord component.Returns the value of theargNamesInPositiveValueMatchesrecord component.Returns the value of theargNamesMarkedMultiRowrecord component.Returns the value of theargNamesWithMultiRowSensitivityrecord component.final booleanIndicates whether some other object is "equal to" this one.static CoreExpressionStatsfrom(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.booleanfinal inthashCode()Returns a hash code value for this object.Set<de.calamanari.adl.Flag> hints()Returns the value of thehintsrecord component.booleanisMultiRowSensitive(String argName) booleanReturns the value of theisSeparateBaseTableRequiredrecord component.Returns the value of therequiredTablesrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CoreExpressionStats
public 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) Creates an instance of aCoreExpressionStatsrecord class.- Parameters:
hints- the value for thehintsrecord componentargNames- the value for theargNamesrecord componentargNamesMarkedMultiRow- the value for theargNamesMarkedMultiRowrecord componentargNamesWithMultiRowSensitivity- the value for theargNamesWithMultiRowSensitivityrecord componentargNamesInPositiveValueMatches- the value for theargNamesInPositiveValueMatchesrecord componentargNamesInNegativeValueMatches- the value for theargNamesInNegativeValueMatchesrecord componentargNamesInPositiveIsUnknownMatches- the value for theargNamesInPositiveIsUnknownMatchesrecord componentargNamesInNegativeIsUnknownMatches- the value for theargNamesInNegativeIsUnknownMatchesrecord componentrequiredTables- the value for therequiredTablesrecord componentisSeparateBaseTableRequired- the value for theisSeparateBaseTableRequiredrecord component
-
-
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
- 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
-
hashCode
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
hints
-
argNames
-
argNamesMarkedMultiRow
Returns the value of theargNamesMarkedMultiRowrecord component.- Returns:
- the value of the
argNamesMarkedMultiRowrecord component
-
argNamesWithMultiRowSensitivity
Returns the value of theargNamesWithMultiRowSensitivityrecord component.- Returns:
- the value of the
argNamesWithMultiRowSensitivityrecord component
-
argNamesInPositiveValueMatches
Returns the value of theargNamesInPositiveValueMatchesrecord component.- Returns:
- the value of the
argNamesInPositiveValueMatchesrecord component
-
argNamesInNegativeValueMatches
Returns the value of theargNamesInNegativeValueMatchesrecord component.- Returns:
- the value of the
argNamesInNegativeValueMatchesrecord component
-
argNamesInPositiveIsUnknownMatches
Returns the value of theargNamesInPositiveIsUnknownMatchesrecord component.- Returns:
- the value of the
argNamesInPositiveIsUnknownMatchesrecord component
-
argNamesInNegativeIsUnknownMatches
Returns the value of theargNamesInNegativeIsUnknownMatchesrecord component.- Returns:
- the value of the
argNamesInNegativeIsUnknownMatchesrecord component
-
requiredTables
Returns the value of therequiredTablesrecord component.- Returns:
- the value of the
requiredTablesrecord component
-
isSeparateBaseTableRequired
public boolean isSeparateBaseTableRequired()Returns the value of theisSeparateBaseTableRequiredrecord component.- Returns:
- the value of the
isSeparateBaseTableRequiredrecord component
-