Class MapKeyMethod

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

public class MapKeyMethod extends Object implements SQLMethod
Method for evaluating KEY({mapExpr}). Returns an ObjectExpression representing the key mapping.
  • Constructor Details

    • MapKeyMethod

      public MapKeyMethod()
  • 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
    • getAsJoin

      protected SQLExpression getAsJoin(SQLStatement parentStmt, MapExpression mapExpr)
      Implementation of KEY(mapExpr) using a join to the table representing the map, and returning an expression for the key.
      Parameters:
      parentStmt - The parent SQL statement
      mapExpr - The map expression
      Returns:
      The value expression
    • getAsSubquery

      protected SQLExpression getAsSubquery(SQLStatement stmt, MapExpression mapExpr)
      Implementation of KEY(mapExpr) using a subquery on the table representing the map.
      Parameters:
      stmt - SQLStatement
      mapExpr - The map expression
      Returns:
      The value expression