Class ObjectLiteral
- java.lang.Object
-
- org.datanucleus.store.rdbms.sql.expression.SQLExpression
-
- org.datanucleus.store.rdbms.sql.expression.ObjectExpression
-
- org.datanucleus.store.rdbms.sql.expression.ObjectLiteral
-
- All Implemented Interfaces:
SQLLiteral
public class ObjectLiteral extends ObjectExpression implements SQLLiteral
Representation of an Object literal in a query.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.datanucleus.store.rdbms.sql.expression.SQLExpression
SQLExpression.ColumnExpressionList
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Object
value
-
Fields inherited from class org.datanucleus.store.rdbms.sql.expression.SQLExpression
lowestOperator, mapping, parameterName, st, stmt, subExprs, table
-
-
Constructor Summary
Constructors Constructor Description ObjectLiteral(SQLStatement stmt, JavaTypeMapping mapping, java.lang.Object value, java.lang.String parameterName)
Constructor for an Object literal with a value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
addSubexpressionsForValue(java.lang.Object value, JavaTypeMapping mapping)
Method to add subExprs for the supplied mapping, consistent with the supplied value.BooleanExpression
eq(SQLExpression expr)
Method called when the query contains "object == value".java.lang.Object
getValue()
Accessor to the literal valueBooleanExpression
ne(SQLExpression expr)
Method called when the query contains "object NOTEQUALS value".void
setNotParameter()
Method to set this literal as not being a parameter.protected void
setStatement()
java.lang.String
toString()
-
Methods inherited from class org.datanucleus.store.rdbms.sql.expression.ObjectExpression
addSubexpressionsToRelatedExpression, cast, ge, gt, in, invoke, is, le, lt, processComparisonOfImplementationWithReference, useFirstColumnOnly
-
Methods inherited from class org.datanucleus.store.rdbms.sql.expression.SQLExpression
add, and, bitAnd, bitOr, com, distinct, div, encloseInParentheses, eor, getJavaTypeMapping, getLowestOperator, getNumberOfSubExpressions, getParameterName, getSQLStatement, getSQLTable, getSubExpression, ior, isParameter, mod, mul, neg, not, setJavaTypeMapping, sub, toSQLText, unDistinct
-
-
-
-
Constructor Detail
-
ObjectLiteral
public ObjectLiteral(SQLStatement stmt, JavaTypeMapping mapping, java.lang.Object value, java.lang.String parameterName)
Constructor for an Object literal with a value.- Parameters:
stmt
- the SQL statementmapping
- the mappingvalue
- the Object valueparameterName
- Name of the parameter that this represents if any (as JDBC "?")
-
-
Method Detail
-
addSubexpressionsForValue
private void addSubexpressionsForValue(java.lang.Object value, JavaTypeMapping mapping)
Method to add subExprs for the supplied mapping, consistent with the supplied value. The value can be a persistent object, or an identity (datastore/application).- Parameters:
value
- The valuemapping
- The mapping
-
getValue
public java.lang.Object getValue()
Description copied from interface:SQLLiteral
Accessor to the literal value- Specified by:
getValue
in interfaceSQLLiteral
- Returns:
- the value of the literal
-
eq
public BooleanExpression eq(SQLExpression expr)
Method called when the query contains "object == value".- Overrides:
eq
in classObjectExpression
- Parameters:
expr
- The expression- Returns:
- The resultant expression for this query relation
-
ne
public BooleanExpression ne(SQLExpression expr)
Method called when the query contains "object NOTEQUALS value".- Overrides:
ne
in classObjectExpression
- Parameters:
expr
- The expression- Returns:
- The resultant expression for this query relation
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
setNotParameter
public void setNotParameter()
Description copied from interface:SQLLiteral
Method to set this literal as not being a parameter. If the literal if not currently a parameter then does nothing. Updates any underlying SQL to have the value.- Specified by:
setNotParameter
in interfaceSQLLiteral
-
setStatement
protected void setStatement()
-
-