Class CollectionLiteral
- java.lang.Object
-
- org.datanucleus.store.rdbms.sql.expression.SQLExpression
-
- org.datanucleus.store.rdbms.sql.expression.CollectionExpression
-
- org.datanucleus.store.rdbms.sql.expression.CollectionLiteral
-
- All Implemented Interfaces:
SQLLiteral
public class CollectionLiteral extends CollectionExpression implements SQLLiteral
An SQL expression that will test if a column of a table falls within the given Collection of values. This is used for queries where a transient Collection is passed in as a parameter.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.datanucleus.store.rdbms.sql.expression.SQLExpression
SQLExpression.ColumnExpressionList
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<SQLExpression>
elementExpressions
Expressions for all elements in the Collectionprivate java.util.Collection
value
-
Fields inherited from class org.datanucleus.store.rdbms.sql.expression.SQLExpression
lowestOperator, mapping, parameterName, st, stmt, subExprs, table
-
-
Constructor Summary
Constructors Constructor Description CollectionLiteral(SQLStatement stmt, JavaTypeMapping mapping, java.lang.Object value, java.lang.String parameterName)
Constructor for a collection literal with a value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<SQLExpression>
getElementExpressions()
java.lang.Object
getValue()
Accessor to the literal valueSQLExpression
invoke(java.lang.String methodName, java.util.List<SQLExpression> args)
Invocation of a method on this expression.void
setNotParameter()
Method to set this literal as not being a parameter.protected void
setStatement()
-
Methods inherited from class org.datanucleus.store.rdbms.sql.expression.CollectionExpression
eq, ne
-
Methods inherited from class org.datanucleus.store.rdbms.sql.expression.SQLExpression
add, and, bitAnd, bitOr, cast, com, distinct, div, encloseInParentheses, eor, ge, getJavaTypeMapping, getLowestOperator, getNumberOfSubExpressions, getParameterName, getSQLStatement, getSQLTable, getSubExpression, gt, in, ior, is, isParameter, le, lt, mod, mul, neg, not, setJavaTypeMapping, sub, toSQLText, unDistinct
-
-
-
-
Field Detail
-
value
private final java.util.Collection value
-
elementExpressions
private java.util.List<SQLExpression> elementExpressions
Expressions for all elements in the Collection
-
-
Constructor Detail
-
CollectionLiteral
public CollectionLiteral(SQLStatement stmt, JavaTypeMapping mapping, java.lang.Object value, java.lang.String parameterName)
Constructor for a collection literal with a value.- Parameters:
stmt
- SQL statementmapping
- The mapping to the Collectionvalue
- The transient Collection that is the value.parameterName
- Name of the parameter that this represents if any (as JDBC "?")
-
-
Method Detail
-
getValue
public java.lang.Object getValue()
Description copied from interface:SQLLiteral
Accessor to the literal value- Specified by:
getValue
in interfaceSQLLiteral
- Returns:
- the value of the literal
-
getElementExpressions
public java.util.List<SQLExpression> getElementExpressions()
-
setNotParameter
public void setNotParameter()
Description copied from interface:SQLLiteral
Method to set this literal as not being a parameter. If the literal if not currently a parameter then does nothing. Updates any underlying SQL to have the value.- Specified by:
setNotParameter
in interfaceSQLLiteral
-
setStatement
protected void setStatement()
-
invoke
public SQLExpression invoke(java.lang.String methodName, java.util.List<SQLExpression> args)
Description copied from class:SQLExpression
Invocation of a method on this expression.- Overrides:
invoke
in classCollectionExpression
- Parameters:
methodName
- name of the method to invokeargs
- Args to this method (if any)- Returns:
- the converted value
-
-