Package org.h2.schema
Class FunctionAlias.JavaMethod
java.lang.Object
org.h2.schema.FunctionAlias.JavaMethod
- All Implemented Interfaces:
Comparable<FunctionAlias.JavaMethod>
- Enclosing class:
FunctionAlias
public static class FunctionAlias.JavaMethod
extends Object
implements Comparable<FunctionAlias.JavaMethod>
There may be multiple Java methods that match a function name.
Each method must have a different number of parameters however.
This helper class represents one such method.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
private Object
execute
(SessionLocal session, Expression[] args, boolean columnList) Class<?>[]
Returns data type information for regular functions ornull
for table value functions.int
getTableValue
(SessionLocal session, Expression[] args, boolean columnList) Call the table user-defined function and return the value.getValue
(SessionLocal session, Expression[] args, boolean columnList) Call the user-defined function and return the value.boolean
Check if this function requires a database connection.boolean
static ResultInterface
resultSetToResult
(SessionLocal session, ResultSet rs, int maxrows) Create a result for the given result set.toString()
-
Field Details
-
id
private final int id -
method
-
dataType
-
hasConnectionParam
private boolean hasConnectionParam -
varArgs
private boolean varArgs -
varArgClass
-
paramCount
private int paramCount
-
-
Constructor Details
-
JavaMethod
JavaMethod(Method method, int id)
-
-
Method Details
-
toString
-
hasConnectionParam
public boolean hasConnectionParam()Check if this function requires a database connection.- Returns:
- if the function requires a connection
-
getValue
Call the user-defined function and return the value.- Parameters:
session
- the sessionargs
- the argument listcolumnList
- true if the function should only return the column list- Returns:
- the value
-
getTableValue
Call the table user-defined function and return the value.- Parameters:
session
- the sessionargs
- the argument listcolumnList
- true if the function should only return the column list- Returns:
- the value
-
resultSetToResult
Create a result for the given result set.- Parameters:
session
- the sessionrs
- the result setmaxrows
- the maximum number of rows to read (0 to just read the meta data)- Returns:
- the value
-
execute
-
getColumnClasses
-
getDataType
Returns data type information for regular functions ornull
for table value functions.- Returns:
- data type information for regular functions or
null
for table value functions
-
getParameterCount
public int getParameterCount() -
isVarArgs
public boolean isVarArgs() -
compareTo
- Specified by:
compareTo
in interfaceComparable<FunctionAlias.JavaMethod>
-