Package org.h2.schema
Class FunctionAlias.JavaMethod
- java.lang.Object
-
- org.h2.schema.FunctionAlias.JavaMethod
-
- All Implemented Interfaces:
java.lang.Comparable<FunctionAlias.JavaMethod>
- Enclosing class:
- FunctionAlias
public static class FunctionAlias.JavaMethod extends java.lang.Object implements java.lang.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 Modifier and Type Field Description private TypeInfodataTypeprivate booleanhasConnectionParamprivate intidprivate java.lang.reflect.Methodmethodprivate intparamCountprivate java.lang.Class<?>varArgClassprivate booleanvarArgs
-
Constructor Summary
Constructors Constructor Description JavaMethod(java.lang.reflect.Method method, int id)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(FunctionAlias.JavaMethod m)private java.lang.Objectexecute(SessionLocal session, Expression[] args, boolean columnList)java.lang.Class<?>[]getColumnClasses()TypeInfogetDataType()Returns data type information for regular functions ornullfor table value functions.intgetParameterCount()ResultInterfacegetTableValue(SessionLocal session, Expression[] args, boolean columnList)Call the table user-defined function and return the value.ValuegetValue(SessionLocal session, Expression[] args, boolean columnList)Call the user-defined function and return the value.booleanhasConnectionParam()Check if this function requires a database connection.booleanisVarArgs()static ResultInterfaceresultSetToResult(SessionLocal session, java.sql.ResultSet rs, int maxrows)Create a result for the given result set.java.lang.StringtoString()
-
-
-
Field Detail
-
id
private final int id
-
method
private final java.lang.reflect.Method method
-
dataType
private final TypeInfo dataType
-
hasConnectionParam
private boolean hasConnectionParam
-
varArgs
private boolean varArgs
-
varArgClass
private java.lang.Class<?> varArgClass
-
paramCount
private int paramCount
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hasConnectionParam
public boolean hasConnectionParam()
Check if this function requires a database connection.- Returns:
- if the function requires a connection
-
getValue
public Value getValue(SessionLocal session, Expression[] args, boolean columnList)
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
public ResultInterface getTableValue(SessionLocal session, Expression[] args, boolean columnList)
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
public static ResultInterface resultSetToResult(SessionLocal session, java.sql.ResultSet rs, int maxrows)
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
private java.lang.Object execute(SessionLocal session, Expression[] args, boolean columnList)
-
getColumnClasses
public java.lang.Class<?>[] getColumnClasses()
-
getDataType
public TypeInfo getDataType()
Returns data type information for regular functions ornullfor table value functions.- Returns:
- data type information for regular functions or
nullfor table value functions
-
getParameterCount
public int getParameterCount()
-
isVarArgs
public boolean isVarArgs()
-
compareTo
public int compareTo(FunctionAlias.JavaMethod m)
- Specified by:
compareToin interfacejava.lang.Comparable<FunctionAlias.JavaMethod>
-
-