Module litebridge.db.spi.impl
Class DelegateColumnExpressionImpl
java.lang.Object
org.litebridge.db.spi.expression.ColumnExpressionImpl
org.litebridge.db.spi.expression.DelegateColumnExpression
org.litebridge.db.spi.impl.function.DelegateColumnExpressionImpl
- All Implemented Interfaces:
ColumnExpression,DelegateExpression,SelectExpression
- Direct Known Subclasses:
FunctionExpression
A nestable column expression with support for SQL aliasing.
This class extends NestableExpression and integrates the functionality
of aliasing of results through a ColumnIdentifierGenerator.
The primary responsibility of this class is to provide SQL representations of nestable function expressions, either with or without an alias.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ColumnIdentifierGeneratorThe generator used for creating SQL column identifiers.Fields inherited from class org.litebridge.db.spi.expression.DelegateColumnExpression
targetFields inherited from class org.litebridge.db.spi.expression.ColumnExpressionImpl
column -
Constructor Summary
ConstructorsConstructorDescriptionDelegateColumnExpressionImpl(ColumnExpression target, ColumnIdentifierGenerator columnIdentifierGenerator) Constructs aDelegateColumnExpressionImplwith the specified target column and identifier generator. -
Method Summary
Modifier and TypeMethodDescriptiontoSql(Operation operation, ClauseType clause, @Nullable DelegateExpression parent) Creates a SQL representation of the expression.Methods inherited from class org.litebridge.db.spi.expression.DelegateColumnExpression
column, targetMethods 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
-
Field Details
-
columnIdentifierGenerator
The generator used for creating SQL column identifiers.
-
-
Constructor Details
-
DelegateColumnExpressionImpl
public DelegateColumnExpressionImpl(ColumnExpression target, ColumnIdentifierGenerator columnIdentifierGenerator) Constructs aDelegateColumnExpressionImplwith the specified target column and identifier generator.- Parameters:
target- the target column expressioncolumnIdentifierGenerator- the generator to use for creating SQL identifiers
-
-
Method Details
-
toSql
Creates a SQL representation of the expression.This is usually used for expressions that do not require any aliases.
- 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
-