Class CollectionExpression

java.lang.Object
org.datanucleus.store.rdbms.sql.expression.SQLExpression
org.datanucleus.store.rdbms.sql.expression.CollectionExpression
Direct Known Subclasses:
CollectionLiteral

public class CollectionExpression extends SQLExpression
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.

  • Constructor Details

    • CollectionExpression

      public CollectionExpression(SQLStatement stmt, SQLTable table, JavaTypeMapping mapping)
      Constructor for an SQL expression for a (field) mapping in a specified table.
      Parameters:
      stmt - The statement
      table - The table in the statement
      mapping - The mapping for the field
  • Method Details

    • invoke

      public SQLExpression invoke(String methodName, List<SQLExpression> args)
      Description copied from class: SQLExpression
      Invocation of a method on this expression.
      Overrides:
      invoke in class SQLExpression
      Parameters:
      methodName - name of the method to invoke
      args - Args to this method (if any)
      Returns:
      the converted value
    • eq

      public BooleanExpression eq(SQLExpression expr)
      Method to return the expression for comparing a collection with a value. Only supports comparisons with null currently.
      Overrides:
      eq in class SQLExpression
      Parameters:
      expr - The value to compare with.
      Returns:
      The expression of equality
    • ne

      public BooleanExpression ne(SQLExpression expr)
      Method to return the expression for comparing a collection with a value. Only supports comparisons with null currently.
      Overrides:
      ne in class SQLExpression
      Parameters:
      expr - The value to compare with.
      Returns:
      The expression of inequality