org.datanucleus.store.rdbms.sql.method
Class ListGetMethod

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

public class ListGetMethod
extends AbstractSQLMethod

Method for evaluating {listExpr}.get(idxExpr). Returns an ObjectExpression representing the element


Field Summary
 
Fields inherited from class org.datanucleus.store.rdbms.sql.method.AbstractSQLMethod
clr, exprFactory, LOCALISER, stmt
 
Constructor Summary
ListGetMethod()
           
 
Method Summary
protected  SQLExpression getAsInnerJoin(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.
protected  SQLExpression getAsSubquery(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.
 SQLExpression getExpression(SQLExpression expr, List args)
          Return the expression for this SQL function.
 
Methods inherited from class org.datanucleus.store.rdbms.sql.method.AbstractSQLMethod
getMappingForClass, setStatement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListGetMethod

public ListGetMethod()
Method Detail

getExpression

public SQLExpression getExpression(SQLExpression expr,
                                   List args)
Description copied from interface: SQLMethod
Return the expression for this SQL function.

Parameters:
expr - The expression that it is invoked on
args - Arguments passed in
Returns:
The SQL expression using the SQL function

getAsSubquery

protected SQLExpression getAsSubquery(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:
listExpr - The list expression
idxExpr - The index expression
Returns:
The element expression

getAsInnerJoin

protected SQLExpression getAsInnerJoin(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:
listExpr - The list expression
idxExpr - The index expression
Returns:
The element expression


Copyright © 2012. All Rights Reserved.