Class ListGetMethod

java.lang.Object
org.datanucleus.store.rdbms.sql.method.ListGetMethod
All Implemented Interfaces:
SQLMethod

public class ListGetMethod extends Object implements SQLMethod
Method for evaluating {listExpr}.get(idxExpr). Returns an ObjectExpression representing the element
  • Constructor Details

    • ListGetMethod

      public ListGetMethod()
  • Method Details

    • getExpression

      public SQLExpression getExpression(SQLStatement stmt, SQLExpression expr, List<SQLExpression> args)
      Description copied from interface: SQLMethod
      Return the expression for this SQL function.
      Specified by:
      getExpression in interface SQLMethod
      Parameters:
      stmt - SQLStatement that this expression is for
      expr - The expression that it is invoked on
      args - Arguments passed in
      Returns:
      The SQL expression using the SQL function
    • getAsSubquery

      protected SQLExpression getAsSubquery(SQLStatement stmt, CollectionExpression listExpr, SQLExpression idxExpr)
      Implementation of Collection.get() using a subquery on the table representing the collection, adding a condition on the index and returning the element.
      Parameters:
      stmt - SQLStatement
      listExpr - The list expression
      idxExpr - The index expression
      Returns:
      The element expression
    • getAsInnerJoin

      protected SQLExpression getAsInnerJoin(SQLStatement stmt, CollectionExpression listExpr, SQLExpression idxExpr)
      Implementation of List.get() using an inner join to the table representing the list, adding a condition on the index and returning the element.
      Parameters:
      stmt - SQLStatement
      listExpr - The list expression
      idxExpr - The index expression
      Returns:
      The element expression