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

java.lang.Object
  extended by com.mysema.query.types.MutableExpressionBase<T>
      extended by com.mysema.query.types.expr.Coalesce<T>
Type Parameters:
T - expression type
All Implemented Interfaces:
Expression<T>, Serializable

public class Coalesce<T extends Comparable>
extends MutableExpressionBase<T>

Coalesce defines a coalesce function invocation. The coalesce function returns null if all arguments are null and the first non-null argument otherwise

Coalesce doesn't provide the full interface for comparable expressions. To get an immutable copy with the full expressiveness of Comparable expressions, call getValue().

Author:
tiwe
See Also:
Serialized Form

Constructor Summary
Coalesce(Class<? extends T> type, Expression<?>... exprs)
           
Coalesce(Expression... exprs)
           
 
Method Summary
<R,C> R
accept(Visitor<R,C> v, C context)
          Accept the visitor with the given context
 Coalesce<T> add(Expression<T> expr)
           
 Coalesce<T> add(T constant)
           
 DslExpression<T> as(Path<T> alias)
          Create an alias for the expression
 DslExpression<T> as(String alias)
          Create an alias for the expression
 BooleanExpression asBoolean()
           
 DateExpression<T> asDate()
           
 DateTimeExpression<T> asDateTime()
           
 EnumExpression<?> asEnum()
           
 NumberExpression<?> asNumber()
           
 StringExpression asString()
           
 TimeExpression<T> asTime()
           
 boolean equals(Object o)
           
 ComparableExpression<T> getValue()
           
 
Methods inherited from class com.mysema.query.types.MutableExpressionBase
getType, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Coalesce

public Coalesce(Class<? extends T> type,
                Expression<?>... exprs)

Coalesce

public Coalesce(Expression... exprs)
Method Detail

accept

public <R,C> R accept(Visitor<R,C> v,
                      C context)
Description copied from interface: Expression
Accept the visitor with the given context

Type Parameters:
R - return type
C - context type
Parameters:
v - visitor
context - context of visit
Returns:

getValue

public ComparableExpression<T> getValue()

as

public DslExpression<T> as(Path<T> alias)
Create an alias for the expression

Returns:

as

public DslExpression<T> as(String alias)
Create an alias for the expression

Returns:

add

public final Coalesce<T> add(Expression<T> expr)

add

public final Coalesce<T> add(T constant)

asBoolean

public BooleanExpression asBoolean()

asDate

public DateExpression<T> asDate()

asDateTime

public DateTimeExpression<T> asDateTime()

asEnum

public EnumExpression<?> asEnum()

asNumber

public NumberExpression<?> asNumber()

asString

public StringExpression asString()

asTime

public TimeExpression<T> asTime()

equals

public boolean equals(Object o)
Overrides:
equals in class Object


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