org.datanucleus.store.rdbms.sql.expression
Class ObjectLiteral

java.lang.Object
  extended by org.datanucleus.store.rdbms.sql.expression.SQLExpression
      extended by org.datanucleus.store.rdbms.sql.expression.ObjectExpression
          extended by 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 inherited from class org.datanucleus.store.rdbms.sql.expression.SQLExpression
isParameter, LOCALISER, lowestOperator, mapping, st, stmt, subExprs, table
 
Constructor Summary
ObjectLiteral(SQLStatement stmt, org.datanucleus.store.mapped.mapping.JavaTypeMapping mapping, java.lang.Object value, boolean parameter)
          Constructor for an Object literal with a value.
 
Method Summary
 BooleanExpression eq(SQLExpression expr)
          Method called when the query contains "object == value".
protected  BooleanExpression getEqualityExpressionForObjectExpression(ObjectExpression expr)
           
 java.lang.Object getValue()
          Accessor to the literal value
 BooleanExpression ne(SQLExpression expr)
          Method called when the query contains "object NOTEQUALS value".
 void setNotParameter()
          Method to set this literal as not being a parameter.
 java.lang.String toString()
           
 
Methods inherited from class org.datanucleus.store.rdbms.sql.expression.ObjectExpression
cast, in, is, useFirstColumnOnly
 
Methods inherited from class org.datanucleus.store.rdbms.sql.expression.SQLExpression
add, and, checkForAndCorrectParameterComparison, com, div, encloseInParentheses, eor, ge, getJavaTypeMapping, getNumberOfSubExpressions, getSQLStatement, getSQLTable, gt, invoke, ior, isParameter, le, lt, mod, mul, neg, not, sub, toSQLText
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ObjectLiteral

public ObjectLiteral(SQLStatement stmt,
                     org.datanucleus.store.mapped.mapping.JavaTypeMapping mapping,
                     java.lang.Object value,
                     boolean parameter)
Constructor for an Object literal with a value.

Parameters:
stmt - the SQL statement
mapping - the mapping
value - the Object value
parameter - Whether this is treated as a parameter (JDBC "?")
Method Detail

getValue

public java.lang.Object getValue()
Description copied from interface: SQLLiteral
Accessor to the literal value

Specified by:
getValue in interface SQLLiteral
Returns:
the value of the literal

eq

public BooleanExpression eq(SQLExpression expr)
Method called when the query contains "object == value".

Overrides:
eq in class ObjectExpression
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 class ObjectExpression
Parameters:
expr - The expression
Returns:
The resultant expression for this query relation

getEqualityExpressionForObjectExpression

protected BooleanExpression getEqualityExpressionForObjectExpression(ObjectExpression expr)

toString

public java.lang.String toString()
Overrides:
toString in class java.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 interface SQLLiteral


Copyright © 2009. All Rights Reserved.