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
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 SQLExpression
SQLExpression.ColumnExpressionList -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate List<SQLExpression> Expressions for all elements in the Collectionprivate final CollectionFields inherited from class SQLExpression
lowestOperator, mapping, parameterName, st, stmt, subExprs, table -
Constructor Summary
ConstructorsConstructorDescriptionCollectionLiteral(SQLStatement stmt, JavaTypeMapping mapping, Object value, String parameterName) Constructor for a collection literal with a value. -
Method Summary
Modifier and TypeMethodDescriptiongetValue()Accessor to the literal valueinvoke(String methodName, List<SQLExpression> args) Invocation of a method on this expression.voidMethod to set this literal as not being a parameter.protected voidMethods inherited from class CollectionExpression
eq, neMethods inherited from class 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 Details
-
value
-
elementExpressions
Expressions for all elements in the Collection
-
-
Constructor Details
-
CollectionLiteral
public CollectionLiteral(SQLStatement stmt, JavaTypeMapping mapping, Object value, 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 Details
-
getValue
Description copied from interface:SQLLiteralAccessor to the literal value- Specified by:
getValuein interfaceSQLLiteral- Returns:
- the value of the literal
-
getElementExpressions
-
setNotParameter
public void setNotParameter()Description copied from interface:SQLLiteralMethod 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:
setNotParameterin interfaceSQLLiteral
-
setStatement
protected void setStatement() -
invoke
Description copied from class:SQLExpressionInvocation of a method on this expression.- Overrides:
invokein classCollectionExpression- Parameters:
methodName- name of the method to invokeargs- Args to this method (if any)- Returns:
- the converted value
-