java.lang.Object
org.litebridge.orm.api.select.model.ProtoExpressionResolver
- Direct Known Subclasses:
DtoProtoExpressionResolver,SqlProtoExpressionResolver
Resolver for proto-expressions that have not yet been bound to a specific table or context.
This class provides methods for resolving these proto-expressions into final
ExpressionSpecs that can be used by the database provider.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ColumngetColumn(Resolvable resolvable, ClauseType clause) Returns the database column for a resolvable.static booleanisSupported(Class<? extends ExpressionSpec> type) Checks if a given expression type is supported for resolution.protected Stream<ExpressionSpec> resolveConvertSpec(ConvertSpec<?> convertSpec, ClauseType clause) Resolves a convert specification.resolveExpression(ExpressionSpec expressionSpec, ClauseType clause) Resolves a proto-expression into anExpressionSpec.resolveExpression(Resolvable resolvable, ClauseType clause) Resolves aResolvableinto anExpressionSpec.resolveExpressions(List<ExpressionSpec> expressionSpecs, ClauseType clause) Resolves a list of expression specifications.protected abstract ColumnExpressionSpecresolveSelectField(Resolvable resolvable, ClauseType clause) Resolves a resolvable into a column expression specification.protected abstract ColumnExpressionSpecresolveSelectField(QueryField queryField, ClauseType clause) Resolves a query field into a column expression specification.
-
Constructor Details
-
ProtoExpressionResolver
public ProtoExpressionResolver()
-
-
Method Details
-
resolveExpression
Resolves a proto-expression into anExpressionSpec.If the input expression is not a
Resolvable, it returns the expression as is.- Parameters:
expressionSpec- the proto-expression to resolveclause- the clause type where the expression is being used- Returns:
- the resolved
ExpressionSpeccorresponding to the provided column
-
resolveExpression
Resolves aResolvableinto anExpressionSpec.If the input expression is not a
Resolvable, it returns the expression as is.- Parameters:
resolvable- theResolvableto resolveclause- the clause type where the expression is being used- Returns:
- the resolved
ExpressionSpeccorresponding to the provided column
-
resolveExpressions
public List<ExpressionSpec> resolveExpressions(List<ExpressionSpec> expressionSpecs, ClauseType clause) Resolves a list of expression specifications.- Parameters:
expressionSpecs- the list of expression specifications to resolveclause- the clause type where the expressions are being used- Returns:
- the list of resolved expression specifications
-
resolveConvertSpec
Resolves a convert specification.- Parameters:
convertSpec- the convert specification to resolveclause- the clause type where the expression is being used- Returns:
- a stream containing the resolved expression specification
-
isSupported
Checks if a given expression type is supported for resolution.- Parameters:
type- the expression type to check- Returns:
trueif supported,falseotherwise
-
resolveSelectField
protected abstract ColumnExpressionSpec resolveSelectField(Resolvable resolvable, ClauseType clause) Resolves a resolvable into a column expression specification.- Parameters:
resolvable- the resolvable to resolveclause- the clause type where the expression is being used- Returns:
- the resolved column expression specification
-
resolveSelectField
protected abstract ColumnExpressionSpec resolveSelectField(QueryField queryField, ClauseType clause) Resolves a query field into a column expression specification.- Parameters:
queryField- the query field to resolveclause- the clause type where the expression is being used- Returns:
- the resolved column expression specification
-
getColumn
Returns the database column for a resolvable.- Parameters:
resolvable- the resolvable to get the column forclause- the clause type where the expression is being used- Returns:
- the database column
-