java.lang.Object
org.litebridge.db.spi.expression.ColumnExpressionImpl
org.litebridge.db.spi.expression.DelegateColumnExpression
org.litebridge.db.spi.impl.function.DelegateColumnExpressionImpl
org.litebridge.db.spi.impl.function.FunctionExpression
- All Implemented Interfaces:
ColumnExpression,DelegateExpression,SelectExpression
Base class for function expressions operating on a column.
-
Field Summary
Fields inherited from class org.litebridge.db.spi.impl.function.DelegateColumnExpressionImpl
columnIdentifierGeneratorFields inherited from class org.litebridge.db.spi.expression.DelegateColumnExpression
targetFields inherited from class org.litebridge.db.spi.expression.ColumnExpressionImpl
column -
Constructor Summary
ConstructorsConstructorDescriptionFunctionExpression(ColumnExpression target, ColumnIdentifierGenerator columnIdentifierGenerator) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Stringtemplate()Gets the template for the SQL representation of the function.toSql(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
-
Constructor Details
-
FunctionExpression
public FunctionExpression(ColumnExpression target, ColumnIdentifierGenerator columnIdentifierGenerator) Constructor.- Parameters:
target- Target column expression to encapsulate.columnIdentifierGenerator- Database provider-specific column identifier generator.
-
-
Method Details
-
toSql
Creates a SQL representation of the expression.This is usually used for expressions that do not require any aliases.
- Specified by:
toSqlin interfaceSelectExpression- Overrides:
toSqlin classDelegateColumnExpressionImpl- 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
-
template
Gets the template for the SQL representation of the function.The template should contain a single "%s" placeholder for the column identifier.
- Returns:
- SQL representation template
-