Module litebridge.db.spi.impl
Class LiteralExpressionImpl
java.lang.Object
org.litebridge.db.spi.impl.expression.AbstractExpression
org.litebridge.db.spi.impl.expression.AbstractAliasedExpression
org.litebridge.db.spi.impl.expression.LiteralExpressionImpl
- All Implemented Interfaces:
AliasedExpression,LiteralExpression,SelectExpression
An encapsulated literal value in a query expression.
-
Field Summary
Fields inherited from class org.litebridge.db.spi.impl.expression.AbstractAliasedExpression
alias, tableAliasFields inherited from class org.litebridge.db.spi.impl.expression.AbstractExpression
labelGenerator -
Constructor Summary
ConstructorsConstructorDescriptionLiteralExpressionImpl(@Nullable Object value, @Nullable String alias, LabelGenerator labelGenerator) Constructs a newLiteralExpressionImplwith the given value.LiteralExpressionImpl(@Nullable Object value, LabelGenerator labelGenerator) Constructs a newLiteralExpressionImplwith the given value and no alias. -
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()toBindValueSql(ClauseType clause) Generates a SQL fragment with a placeholder for a bind value.toSql(Operation operation, ClauseType clause, @Nullable DelegateExpression parent) Creates a SQL representation of the expression, providing the immediate nesting/parent expression.toString()@Nullable Objectvalue()Retrieves the value of this literal expression.Methods inherited from class org.litebridge.db.spi.impl.expression.AbstractAliasedExpression
addAliasAs, alias, tableAliasMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.litebridge.db.spi.expression.AliasedExpression
alias, tableAliasMethods inherited from interface org.litebridge.db.spi.expression.SelectExpression
toSql
-
Constructor Details
-
LiteralExpressionImpl
public LiteralExpressionImpl(@Nullable Object value, @Nullable String alias, LabelGenerator labelGenerator) Constructs a newLiteralExpressionImplwith the given value.- Parameters:
value- the literal value to be representedlabelGenerator- generator for rendering aliases/identifiers
-
LiteralExpressionImpl
Constructs a newLiteralExpressionImplwith the given value and no alias.- Parameters:
value- the literal value to be representedlabelGenerator- generator for rendering aliases/identifiers
-
-
Method Details
-
value
Description copied from interface:LiteralExpressionRetrieves the value of this literal expression.- Specified by:
valuein interfaceLiteralExpression- Returns:
- the literal value encapsulated by this expression
-
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
-
toBindValueSql
Generates a SQL fragment with a placeholder for a bind value.- Parameters:
clause- the query clause type- Returns:
- the SQL fragment with bind placeholders
-
equals
- Overrides:
equalsin classAbstractAliasedExpression
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractAliasedExpression
-
toString
- Overrides:
toStringin classAbstractAliasedExpression
-