Module litebridge.db.spi.impl
Class BindValueExpressionImpl
java.lang.Object
org.litebridge.db.spi.impl.expression.AbstractExpression
org.litebridge.db.spi.impl.expression.AbstractAliasedExpression
org.litebridge.db.spi.impl.expression.BindValueExpressionImpl
- All Implemented Interfaces:
AliasedExpression,BindValueExpression,SelectExpression
public class BindValueExpressionImpl
extends AbstractAliasedExpression
implements BindValueExpression
An encapsulated literal value in a query expression.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final @Nullable Stringprotected final ColumnTypeprotected final intprotected final intFields inherited from class org.litebridge.db.spi.impl.expression.AbstractAliasedExpression
tableAliasFields inherited from class org.litebridge.db.spi.impl.expression.AbstractExpression
labelGenerator -
Constructor Summary
ConstructorsConstructorDescriptionBindValueExpressionImpl(int index, int size, ColumnType columnType, @Nullable String alias, LabelGenerator labelGenerator) Creates a newBindValueExpressionImplinstance. -
Method Summary
Modifier and TypeMethodDescriptionGets the data type and size of the bind value data type.booleaninthashCode()intindex()Gets the bind value index.intsize()Gets the length/number of bind values (e.g. for collection expressions).toSql(Operation operation, ClauseType clause, @Nullable DelegateExpression parent) Creates a SQL representation of the expression, providing the immediate nesting/parent expression.toString()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
-
Field Details
-
index
protected final int index -
size
protected final int size -
columnType
-
alias
-
-
Constructor Details
-
BindValueExpressionImpl
public BindValueExpressionImpl(int index, int size, ColumnType columnType, @Nullable String alias, LabelGenerator labelGenerator) Creates a newBindValueExpressionImplinstance.- Parameters:
index- the index of the bind valuesize- the size of the bind value (e.g. for collection expressions)columnType- the data type of the bind valuealias- the alias for the expressionlabelGenerator- the label generator for rendering aliases/identifiers
-
-
Method Details
-
index
public int index()Description copied from interface:BindValueExpressionGets the bind value index.- Specified by:
indexin interfaceBindValueExpression- Returns:
- The index of the bind value.
-
size
public int size()Description copied from interface:BindValueExpressionGets the length/number of bind values (e.g. for collection expressions).- Specified by:
sizein interfaceBindValueExpression- Returns:
- The length/size of the bind value.
-
columnType
Description copied from interface:BindValueExpressionGets the data type and size of the bind value data type.- Specified by:
columnTypein interfaceBindValueExpression- Returns:
- The data type and size of the bind value data type.
-
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
-
equals
- Overrides:
equalsin classAbstractAliasedExpression
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractAliasedExpression
-
toString
- Overrides:
toStringin classAbstractAliasedExpression
-