Class MapExpression

java.lang.Object
org.datanucleus.store.rdbms.sql.expression.SQLExpression
org.datanucleus.store.rdbms.sql.expression.MapExpression
Direct Known Subclasses:
MapLiteral

public class MapExpression extends SQLExpression
An expression that represents some Map field in a query candidate class, or a Map field in an object linked from the candidate class by navigation.
  • Field Details

  • Constructor Details

    • MapExpression

      public MapExpression(SQLStatement stmt, SQLTable table, JavaTypeMapping mapping)
      Constructor.
      Parameters:
      stmt - The SQL Statement
      table - Table containing the map field
      mapping - The java field mapping
  • Method Details

    • setAliasForMapTable

      public void setAliasForMapTable(String alias)
      Method to set the alias for the "map" table (join table, or key table when value in key, or value table when key in value) when specified in FROM.
      Parameters:
      alias - The alias for the map table
    • getAliasForMapTable

      public String getAliasForMapTable()
      Accessor for the "map" table where this expression represents an alias set in the FROM clause, so already joined.
      Returns:
      Alias for the "map" table (if defined in FROM)
    • 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 map 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 map 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