java.lang.Object
org.litebridge.db.spi.expression.ConvertExpression
- All Implemented Interfaces:
DelegateExpression,SelectExpression
Represents a conversion expression that wraps another
SelectExpression,
potentially overriding its type.
This class serves as a decorator around a target SelectExpression, allowing
for an optional type override. It delegates SQL generation to the encapsulated target
expression.
-
Constructor Summary
ConstructorsConstructorDescriptionConvertExpression(SelectExpression target, Class<?> typeOverride) Constructor. -
Method Summary
Modifier and TypeMethodDescriptiontarget()Retrieves the target expression of this delegate.toSql(Operation operation, ClauseType clause, @Nullable DelegateExpression parent) Creates a SQL representation of the expression, providing the immediate nesting/parent expression.Class<?> Retrieves the class type that overrides the default type of the wrappedSelectExpression.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.litebridge.db.spi.expression.SelectExpression
toSql
-
Constructor Details
-
ConvertExpression
Constructor.- Parameters:
target- The encapsulated target column expression for this expression.typeOverride- The class type that overrides the default type.
-
-
Method Details
-
toSql
Description copied from interface:SelectExpressionCreates a SQL representation of the expression, providing the immediate nesting/parent expression.- Specified by:
toSqlin interfaceSelectExpression- Parameters:
operation- the operation that is being executedclause- The current clause type being evaluatedparent- The parent expression/nesting expression, ornullif this is a top-level expression- Returns:
- the SQL representation of the expression
-
target
Description copied from interface:DelegateExpressionRetrieves the target expression of this delegate.- Specified by:
targetin interfaceDelegateExpression- Returns:
- The target expression.
-
typeOverride
Retrieves the class type that overrides the default type of the wrappedSelectExpression.- Returns:
- The type override, or
nullif no override is specified.
-