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

public final Class HashFunction

extends FunctionN
Class Inheritance
Static Imports
org.h2.util.Bits.INT_VH_BE, .Bits.LONG_VH_BE

A HASH or ORA_HASH function.

Field Summary

Modifier and TypeField and Description
private final int
public static final int
HASH

HASH() (non-standard).

private static final String[]
public static final int
ORA_HASH

ORA_HASH() (non-standard).

Constructor Summary

AccessConstructor and Description
public
HashFunction(Expression arg, int function)

public
HashFunction(Expression arg1, Expression arg2, Expression arg3, int function)

Method Summary

Modifier and TypeMethod and Description
private static Value
getHash(String algorithm, Value value, int iterations)

public String
public Value
getValue(SessionLocal
the session
session
,
Value
the value of first argument, or null
v1
,
Value
the value of second argument, or null
v2
,
Value
the value of third argument, or null
v3
)

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

Returns the value of this function.

private static MessageDigest
hashImpl(Value value, String algorithm)

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

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

Try to optimize the expression.

private static Value
oraHash(Value value, long bucket, long seed)

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

Field Detail

functionback to summary
private final int function
HASHback to summary
public static final int HASH

HASH() (non-standard).

NAMESback to summary
private static final String[] NAMES
ORA_HASHback to summary
public static final int ORA_HASH

ORA_HASH() (non-standard).

Constructor Detail

HashFunctionback to summary
public HashFunction(Expression arg, int function)
HashFunctionback to summary
public HashFunction(Expression arg1, Expression arg2, Expression arg3, int function)

Method Detail

getHashback to summary
private static Value getHash(String algorithm, Value value, int iterations)
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
getValueback to summary
public Value getValue(SessionLocal session, Value v1, Value v2, Value v3)

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

Doc from org.h2.expression.function.FunctionN.getValue.

Returns the value of this function.

Parameters
session:SessionLocal

the session

v1:Value

the value of first argument, or null

v2:Value

the value of second argument, or null

v3:Value

the value of third argument, or null

Returns:Value

the resulting value

Annotations
@Override
hashImplback to summary
private static MessageDigest hashImpl(Value value, String algorithm)
hashImplback to summary
private static MessageDigest hashImpl(Value value, MessageDigest md)
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
oraHashback to summary
private static Value oraHash(Value value, long bucket, long seed)