com.mysema.query.types.expr
Class DateTimeExpression<T extends Comparable>

java.lang.Object
  extended by com.mysema.query.types.expr.DslExpression<T>
      extended by com.mysema.query.types.expr.SimpleExpression<T>
          extended by com.mysema.query.types.expr.ComparableExpressionBase<T>
              extended by com.mysema.query.types.expr.ComparableExpression<T>
                  extended by com.mysema.query.types.expr.TemporalExpression<T>
                      extended by com.mysema.query.types.expr.DateTimeExpression<T>
Type Parameters:
T - expression type
All Implemented Interfaces:
Expression<T>, Serializable
Direct Known Subclasses:
DateTimeOperation, DateTimePath, DateTimeSubQuery, DateTimeTemplate

public abstract class DateTimeExpression<T extends Comparable>
extends TemporalExpression<T>

DateTimeExpression represents Date / Time expressions The date representation is compatible with the Gregorian calendar.

Author:
tiwe
See Also:
Gregorian calendar, Serialized Form

Field Summary
 
Fields inherited from class com.mysema.query.types.expr.DslExpression
mixin
 
Constructor Summary
DateTimeExpression(Expression<T> mixin)
           
 
Method Summary
 DateTimeExpression<T> as(Path<T> alias)
          Create an alias for the expression
 DateTimeExpression<T> as(String alias)
          Create an alias for the expression
static DateTimeExpression<Date> currentDate()
          Get an expression representing the current date as a DateTimeExpression instance
static
<T extends Comparable>
DateTimeExpression<T>
currentDate(Class<T> cl)
          Get an expression representing the current date as a DateTimeExpression instance
static DateTimeExpression<Date> currentTimestamp()
          Get an expression representing the current time instant as a DateTimeExpression instance
static
<T extends Comparable>
DateTimeExpression<T>
currentTimestamp(Class<T> cl)
          Get an expression representing the current time instant as a DateTimeExpression instance
 NumberExpression<Integer> dayOfMonth()
          Get a day of month expression (range 1-31)
 NumberExpression<Integer> dayOfWeek()
          Get a day of week expression (range 1-7 / SUN-SAT)
 NumberExpression<Integer> dayOfYear()
          Get a day of year expression (range 1-356)
 NumberExpression<Integer> hour()
          Get a hours expression (range 0-23)
 DateTimeExpression<T> max()
          Get the maximum value of this expression (aggregation)
 NumberExpression<Integer> milliSecond()
          Get a milliseconds expression (range 0-999)
 DateTimeExpression<T> min()
          Get the minimum value of this expression (aggregation)
 NumberExpression<Integer> minute()
          Get a minutes expression (range 0-59)
 NumberExpression<Integer> month()
          Get a month expression (range 1-12 / JAN-DEC)
 NumberExpression<Integer> second()
          Get a seconds expression (range 0-59)
 NumberExpression<Integer> week()
          Get a week expression
 NumberExpression<Integer> year()
          Get a year expression
 NumberExpression<Integer> yearMonth()
          Get a year / month expression
 
Methods inherited from class com.mysema.query.types.expr.TemporalExpression
after, after, before, before
 
Methods inherited from class com.mysema.query.types.expr.ComparableExpression
between, between, goe, goe, goeAll, goeAny, gt, gt, gtAll, gtAny, loe, loe, loeAll, loeAny, lt, lt, ltAll, ltAny, notBetween, notBetween
 
Methods inherited from class com.mysema.query.types.expr.ComparableExpressionBase
asc, castToNum, coalesce, coalesce, desc, stringValue
 
Methods inherited from class com.mysema.query.types.expr.SimpleExpression
count, countDistinct, eq, eq, eqAll, eqAny, in, in, in, isNotNull, isNull, ne, ne, neAll, neAny, notIn, notIn, notIn, when, when
 
Methods inherited from class com.mysema.query.types.expr.DslExpression
equals, getType, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.mysema.query.types.Expression
accept
 

Constructor Detail

DateTimeExpression

public DateTimeExpression(Expression<T> mixin)
Method Detail

currentDate

public static DateTimeExpression<Date> currentDate()
Get an expression representing the current date as a DateTimeExpression instance

Returns:

currentDate

public static <T extends Comparable> DateTimeExpression<T> currentDate(Class<T> cl)
Get an expression representing the current date as a DateTimeExpression instance

Returns:

currentTimestamp

public static DateTimeExpression<Date> currentTimestamp()
Get an expression representing the current time instant as a DateTimeExpression instance

Returns:

currentTimestamp

public static <T extends Comparable> DateTimeExpression<T> currentTimestamp(Class<T> cl)
Get an expression representing the current time instant as a DateTimeExpression instance

Returns:

as

public DateTimeExpression<T> as(Path<T> alias)
Description copied from class: SimpleExpression
Create an alias for the expression

Overrides:
as in class ComparableExpression<T extends Comparable>
Returns:

as

public DateTimeExpression<T> as(String alias)
Description copied from class: SimpleExpression
Create an alias for the expression

Overrides:
as in class ComparableExpression<T extends Comparable>
Returns:

dayOfMonth

public NumberExpression<Integer> dayOfMonth()
Get a day of month expression (range 1-31)

Returns:

dayOfWeek

public NumberExpression<Integer> dayOfWeek()
Get a day of week expression (range 1-7 / SUN-SAT)

NOT supported in JDOQL and not in Derby

Returns:

dayOfYear

public NumberExpression<Integer> dayOfYear()
Get a day of year expression (range 1-356)

NOT supported in JDOQL and not in Derby

Returns:

hour

public NumberExpression<Integer> hour()
Get a hours expression (range 0-23)

Returns:

max

public DateTimeExpression<T> max()
Get the maximum value of this expression (aggregation)

Returns:
max(this)

milliSecond

public NumberExpression<Integer> milliSecond()
Get a milliseconds expression (range 0-999)

Is always 0 in HQL and JDOQL modules

Returns:

min

public DateTimeExpression<T> min()
Get the minimum value of this expression (aggregation)

Returns:
min(this)

minute

public NumberExpression<Integer> minute()
Get a minutes expression (range 0-59)

Returns:

month

public NumberExpression<Integer> month()
Get a month expression (range 1-12 / JAN-DEC)

Returns:

second

public NumberExpression<Integer> second()
Get a seconds expression (range 0-59)

Returns:

week

public NumberExpression<Integer> week()
Get a week expression

Returns:

year

public NumberExpression<Integer> year()
Get a year expression

Returns:

yearMonth

public NumberExpression<Integer> yearMonth()
Get a year / month expression

Returns:


Copyright © 2007-2012 Mysema Ltd. All Rights Reserved.