Class CollectionExpression
java.lang.Object
org.datanucleus.store.rdbms.sql.expression.SQLExpression
org.datanucleus.store.rdbms.sql.expression.CollectionExpression
- Direct Known Subclasses:
CollectionLiteral
An expression that represents some collection field in a query candidate class,
or a collection field in an object linked from the candidate class by navigation.
When navigated through using contains(expr), the elements of the collection are relationally joined onto the query statement.
As this is a Collection Expression it works equally for Sets and Lists, and we use CollectionStore as the backing store interface, so that ListStore and SetStore are equally applicable.
-
Nested Class Summary
Nested classes/interfaces inherited from class SQLExpression
SQLExpression.ColumnExpressionList -
Field Summary
Fields inherited from class SQLExpression
lowestOperator, mapping, parameterName, st, stmt, subExprs, table -
Constructor Summary
ConstructorsConstructorDescriptionCollectionExpression(SQLStatement stmt, SQLTable table, JavaTypeMapping mapping) Constructor for an SQL expression for a (field) mapping in a specified table. -
Method Summary
Modifier and TypeMethodDescriptioneq(SQLExpression expr) Method to return the expression for comparing a collection with a value.invoke(String methodName, List<SQLExpression> args) Invocation of a method on this expression.ne(SQLExpression expr) Method to return the expression for comparing a collection with a value.Methods 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
-
Constructor Details
-
CollectionExpression
Constructor for an SQL expression for a (field) mapping in a specified table.- Parameters:
stmt- The statementtable- The table in the statementmapping- The mapping for the field
-
-
Method Details
-
invoke
Description copied from class:SQLExpressionInvocation of a method on this expression.- Overrides:
invokein classSQLExpression- Parameters:
methodName- name of the method to invokeargs- Args to this method (if any)- Returns:
- the converted value
-
eq
Method to return the expression for comparing a collection with a value. Only supports comparisons with null currently.- Overrides:
eqin classSQLExpression- Parameters:
expr- The value to compare with.- Returns:
- The expression of equality
-
ne
Method to return the expression for comparing a collection with a value. Only supports comparisons with null currently.- Overrides:
nein classSQLExpression- Parameters:
expr- The value to compare with.- Returns:
- The expression of inequality
-