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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.datanucleus.store.rdbms.sql.expression.SQLExpression
SQLExpression.ColumnExpressionList
-
-
Field Summary
-
Fields inherited from class org.datanucleus.store.rdbms.sql.expression.SQLExpression
lowestOperator, mapping, parameterName, st, stmt, subExprs, table
-
-
Constructor Summary
Constructors Constructor Description MapExpression(SQLStatement stmt, SQLTable table, JavaTypeMapping mapping)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BooleanExpression
eq(SQLExpression expr)
Method to return the expression for comparing a map with a value.String
getAliasForMapTable()
Accessor for the "map" table where this expression represents an alias set in the FROM clause, so already joined.SQLExpression
invoke(String methodName, List args)
Invocation of a method on this expression.BooleanExpression
ne(SQLExpression expr)
Method to return the expression for comparing a map with a value.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.-
Methods inherited from class org.datanucleus.store.rdbms.sql.expression.SQLExpression
add, and, bitAnd, bitOr, cast, com, distinct, div, encloseInParentheses, eor, ge, getJavaTypeMapping, getLowestOperator, getNumberOfSubExpressions, getParameterName, getSQLStatement, getSQLTable, getSubExpression, gt, in, ior, is, isParameter, le, lt, mod, mul, neg, not, setJavaTypeMapping, sub, toSQLText, unDistinct
-
-
-
-
Constructor Detail
-
MapExpression
public MapExpression(SQLStatement stmt, SQLTable table, JavaTypeMapping mapping)
Constructor.- Parameters:
stmt
- The SQL Statementtable
- Table containing the map fieldmapping
- The java field mapping
-
-
Method Detail
-
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 args)
Description copied from class:SQLExpression
Invocation of a method on this expression.- Overrides:
invoke
in classSQLExpression
- Parameters:
methodName
- name of the method to invokeargs
- 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 classSQLExpression
- 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 classSQLExpression
- Parameters:
expr
- The value to compare with.- Returns:
- The expression of inequality
-
-