Class MapGetMethod

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

public class MapGetMethod extends Object implements SQLMethod
Method for evaluating {mapExpr}.get(keyExpr). Returns an ObjectExpression representing the value
  • Constructor Details

    • MapGetMethod

      public MapGetMethod()
  • 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, MapExpression mapExpr, SQLExpression keyValExpr)
      Implementation of Map.get() using a subquery on the table representing the map, adding a condition on the key and returning the value.
      Parameters:
      stmt - SQLStatement
      mapExpr - The map expression
      keyValExpr - The key value expression
      Returns:
      The value expression
    • getAsInnerJoin

      protected SQLExpression getAsInnerJoin(SQLStatement stmt, MapExpression mapExpr, SQLExpression keyValExpr)
      Implementation of Map.get() using an inner join to the table representing the map, adding a condition on the key and returning the value.
      Parameters:
      stmt - SQLStatement
      mapExpr - The map expression
      keyValExpr - The key value expression
      Returns:
      The value expression