org.datanucleus.store.mapped.expression
Class SqlTemporalExpression

java.lang.Object
  extended by org.datanucleus.store.mapped.expression.ScalarExpression
      extended by org.datanucleus.store.mapped.expression.SqlTemporalExpression
Direct Known Subclasses:
SqlDateLiteral, SqlTimeLiteral, SqlTimestampLiteral

public class SqlTemporalExpression
extends ScalarExpression

Representation of an expression with an SQL time type (SQLDate, SQLTime, SQLTimestamp)

Version:
$Revision: 1.10 $

Nested Class Summary
 
Nested classes/interfaces inherited from class org.datanucleus.store.mapped.expression.ScalarExpression
ScalarExpression.DatastoreFieldExpression, ScalarExpression.DyadicOperator, ScalarExpression.ExpressionList, ScalarExpression.IllegalArgumentTypeException, ScalarExpression.IllegalOperationException, ScalarExpression.MethodInvocationException, ScalarExpression.MonadicOperator, ScalarExpression.Operator
 
Field Summary
 
Fields inherited from class org.datanucleus.store.mapped.expression.ScalarExpression
aliasIdentifier, checkForTypeAssignability, expressionList, FILTER, LOCALISER, lowestOperator, mapping, OP_ADD, OP_AND, OP_BETWEEN, OP_COM, OP_CONCAT, OP_DIV, OP_EQ, OP_GT, OP_GTEQ, OP_IN, OP_IS, OP_ISNOT, OP_LIKE, OP_LT, OP_LTEQ, OP_MOD, OP_MUL, OP_NEG, OP_NOT, OP_NOTEQ, OP_NOTIN, OP_NOTLIKE, OP_OR, OP_SUB, parameterName, PROJECTION, qs, st, te
 
Constructor Summary
protected SqlTemporalExpression(QueryExpression qs)
           
  SqlTemporalExpression(QueryExpression qs, JavaTypeMapping mapping, LogicSetExpression te)
           
  SqlTemporalExpression(ScalarExpression operand1, ScalarExpression.DyadicOperator op, ScalarExpression operand2)
          Performs a function on two arguments.
  SqlTemporalExpression(java.lang.String functionName, java.util.List args)
          Generates statement as e.g.
  SqlTemporalExpression(java.lang.String functionName, QueryExpression qs)
          Generates statement as "FUNCTION_NAME"
 
Method Summary
 BooleanExpression eq(ScalarExpression expr)
          Equality operator (equals to)
 NumericExpression getDayMethod()
          Method to return an expression for the day of the month (for this date).
 NumericExpression getHourMethod()
          Method to return an expression for the hour (for this time).
 NumericExpression getMinuteMethod()
          Method to return an expression for the minute (for this time).
 NumericExpression getMonthMethod()
          Method to return an expression for the month (for this date).
 NumericExpression getSecondMethod()
          Method to return an expression for the second (for this time).
 NumericExpression getYearMethod()
          Method to return an expression for the year (for this date).
 BooleanExpression gt(ScalarExpression expr)
          Relational operator (greater than)
 BooleanExpression gteq(ScalarExpression expr)
          Relational operator (greater than or equals)
 BooleanExpression in(ScalarExpression expr)
          In expression.
 BooleanExpression lt(ScalarExpression expr)
          Relational operator (lower than)
 BooleanExpression lteq(ScalarExpression expr)
          Relational operator (lower than or equals)
 BooleanExpression noteq(ScalarExpression expr)
          Equality operator (not equals to)
 
Methods inherited from class org.datanucleus.store.mapped.expression.ScalarExpression
accessField, add, and, as, assertValidTypeForParameterComparison, callMethod, cast, checkForTypeAssignability, com, div, encloseWithInParentheses, eor, equals, getAlias, getConsistentTypeForParameterComparison, getExpressionList, getLogicSetExpression, getMapping, getNonAliasExpression, getQueryExpression, instanceOf, ior, mod, mul, neg, not, setParameterName, sub, toStatementText, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SqlTemporalExpression

protected SqlTemporalExpression(QueryExpression qs)

SqlTemporalExpression

public SqlTemporalExpression(QueryExpression qs,
                             JavaTypeMapping mapping,
                             LogicSetExpression te)
Parameters:
qs - the QueryExpression
mapping - the mapping associated to this expression
te - the TableExpression where this expression refers to

SqlTemporalExpression

public SqlTemporalExpression(java.lang.String functionName,
                             QueryExpression qs)
Generates statement as "FUNCTION_NAME"

Parameters:
functionName -
qs - QueryExpression

SqlTemporalExpression

public SqlTemporalExpression(java.lang.String functionName,
                             java.util.List args)
Generates statement as e.g. FUNCTION_NAME(arg[,argN])

Parameters:
functionName -
args - ScalarExpression list

SqlTemporalExpression

public SqlTemporalExpression(ScalarExpression operand1,
                             ScalarExpression.DyadicOperator op,
                             ScalarExpression operand2)
Performs a function on two arguments. op(operand1,operand2) operand1 op operand2

Parameters:
operand1 - the first expression
op - the operator between operands
operand2 - the second expression
Method Detail

eq

public BooleanExpression eq(ScalarExpression expr)
Description copied from class: ScalarExpression
Equality operator (equals to)

Overrides:
eq in class ScalarExpression
Parameters:
expr - the right-hand operand
Returns:
The type of an equality expression is a boolean

noteq

public BooleanExpression noteq(ScalarExpression expr)
Description copied from class: ScalarExpression
Equality operator (not equals to)

Overrides:
noteq in class ScalarExpression
Parameters:
expr - the right-hand operand
Returns:
The type of an equality expression is a boolean

lt

public BooleanExpression lt(ScalarExpression expr)
Description copied from class: ScalarExpression
Relational operator (lower than)

Overrides:
lt in class ScalarExpression
Parameters:
expr - the right-hand operand
Returns:
true if the value of the left-hand operand is less than the value of the right-hand operand, and otherwise is false.

lteq

public BooleanExpression lteq(ScalarExpression expr)
Description copied from class: ScalarExpression
Relational operator (lower than or equals)

Overrides:
lteq in class ScalarExpression
Parameters:
expr - the right-hand operand
Returns:
true if the value of the left-hand operand is less than or equal to the value of the right-hand operand, and otherwise is false.

gt

public BooleanExpression gt(ScalarExpression expr)
Description copied from class: ScalarExpression
Relational operator (greater than)

Overrides:
gt in class ScalarExpression
Parameters:
expr - the right-hand operand
Returns:
true if the value of the left-hand operand is greater than the value of the right-hand operand, and otherwise is false.

gteq

public BooleanExpression gteq(ScalarExpression expr)
Description copied from class: ScalarExpression
Relational operator (greater than or equals)

Overrides:
gteq in class ScalarExpression
Parameters:
expr - the right-hand operand
Returns:
true if the value of the left-hand operand is greater than or equal the value of the right-hand operand, and otherwise is false.

in

public BooleanExpression in(ScalarExpression expr)
Description copied from class: ScalarExpression
In expression. Return true if this is contained by expr

Overrides:
in in class ScalarExpression
Parameters:
expr - the right-hand expression
Returns:
true if the left-hand expression is contained by the right-hand expression. Otherwise the result is false.

getDayMethod

public NumericExpression getDayMethod()
Method to return an expression for the day of the month (for this date).

Returns:
The expression for the day of the month.

getMonthMethod

public NumericExpression getMonthMethod()
Method to return an expression for the month (for this date).

Returns:
The expression for the month.

getYearMethod

public NumericExpression getYearMethod()
Method to return an expression for the year (for this date).

Returns:
The expression for the year.

getHourMethod

public NumericExpression getHourMethod()
Method to return an expression for the hour (for this time).

Returns:
The expression for the hour.

getMinuteMethod

public NumericExpression getMinuteMethod()
Method to return an expression for the minute (for this time).

Returns:
The expression for the month.

getSecondMethod

public NumericExpression getSecondMethod()
Method to return an expression for the second (for this time).

Returns:
The expression for the second.


Copyright © 2010. All Rights Reserved.