Top Description Fields Constructors Methods
org.h2.expression.function

public final Class CoalesceFunction

extends FunctionN
Class Inheritance
Imports
org.h2.engine.SessionLocal, org.h2.expression.Expression, .TypedValueExpression, org.h2.message.DbException, org.h2.value.TypeInfo, .Value, .ValueNull

A COALESCE, GREATEST, or LEAST function.

Field Summary

Modifier and TypeField and Description
public static final int
COALESCE

COALESCE().

private final int
public static final int
GREATEST

GREATEST() (non-standard).

private boolean
public static final int
LEAST

LEAST() (non-standard).

private static final String[]

Constructor Summary

AccessConstructor and Description
public
CoalesceFunction(int function)

public
CoalesceFunction(int function, Expression... args)

Method Summary

Modifier and TypeMethod and Description
public String
public StringBuilder
getUnenclosedSQL(StringBuilder
string builder
builder
,
int
formatting flags
sqlFlags
)

Overrides org.h2.expression.function.FunctionN.getUnenclosedSQL.

Get the SQL statement of this expression.

public Value
getValue(SessionLocal
the session
session
)

Overrides org.h2.expression.function.FunctionN.getValue.

Return the resulting value for the current row.

private static Value
private Value
public Expression
optimize(SessionLocal
the session
session
)

Implements abstract org.h2.expression.Expression.optimize.

Try to optimize the expression.

public void
setIgnoreNulls(boolean ignoreNulls)

private boolean
test(int comp)

Inherited from org.h2.expression.function.FunctionN:
getValue

Field Detail

COALESCEback to summary
public static final int COALESCE

COALESCE().

functionback to summary
private final int function
GREATESTback to summary
public static final int GREATEST

GREATEST() (non-standard).

ignoreNullsback to summary
private boolean ignoreNulls
LEASTback to summary
public static final int LEAST

LEAST() (non-standard).

NAMESback to summary
private static final String[] NAMES

Constructor Detail

CoalesceFunctionback to summary
public CoalesceFunction(int function)
CoalesceFunctionback to summary
public CoalesceFunction(int function, Expression... args)

Method Detail

getNameback to summary
public String getName()

Implements org.h2.expression.function.NamedExpression.getName.

Doc from org.h2.expression.function.NamedExpression.getName.

Get the name.

Returns:String

the name in uppercase

Annotations
@Override
getUnenclosedSQLback to summary
public StringBuilder getUnenclosedSQL(StringBuilder builder, int sqlFlags)

Overrides org.h2.expression.function.FunctionN.getUnenclosedSQL.

Doc from org.h2.expression.Expression.getUnenclosedSQL.

Get the SQL statement of this expression. This may not always be the original SQL statement, especially after optimization. Enclosing '(' and ')' are never appended.

Parameters
builder:StringBuilder

string builder

sqlFlags:int

formatting flags

Returns:StringBuilder

the specified string builder

Annotations
@Override
getValueback to summary
public Value getValue(SessionLocal session)

Overrides org.h2.expression.function.FunctionN.getValue.

Doc from org.h2.expression.Expression.getValue.

Return the resulting value for the current row.

Parameters
session:SessionLocal

the session

Returns:Value

the result

Annotations
@Override
getWithNullback to summary
private static Value getWithNull(Value v, Value v2)
greatestOrLeastback to summary
private Value greatestOrLeast(SessionLocal session)
optimizeback to summary
public Expression optimize(SessionLocal session)

Implements abstract org.h2.expression.Expression.optimize.

Doc from org.h2.expression.Expression.optimize.

Try to optimize the expression.

Parameters
session:SessionLocal

the session

Returns:Expression

the optimized expression

Annotations
@Override
setIgnoreNullsback to summary
public void setIgnoreNulls(boolean ignoreNulls)
testback to summary
private boolean test(int comp)