Package org.h2.expression.function.table
Class JavaTableFunction
- java.lang.Object
-
- org.h2.expression.function.table.TableFunction
-
- org.h2.expression.function.table.JavaTableFunction
-
- All Implemented Interfaces:
ExpressionWithVariableParameters
,NamedExpression
,HasSQL
public final class JavaTableFunction extends TableFunction
This class wraps a user-defined function.
-
-
Field Summary
Fields Modifier and Type Field Description private FunctionAlias
functionAlias
private FunctionAlias.JavaMethod
javaMethod
-
Fields inherited from class org.h2.expression.function.table.TableFunction
args
-
Fields inherited from interface org.h2.util.HasSQL
ADD_PLAN_INFORMATION, DEFAULT_SQL_FLAGS, NO_CASTS, QUOTE_ONLY_WHEN_REQUIRED, REPLACE_LOBS_FOR_TRACE, TRACE_SQL_FLAGS
-
-
Constructor Summary
Constructors Constructor Description JavaTableFunction(FunctionAlias functionAlias, Expression[] args)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getName()
Get the name.java.lang.StringBuilder
getSQL(java.lang.StringBuilder builder, int sqlFlags)
Appends the SQL statement of this object to the specified builder.ResultInterface
getValue(SessionLocal session)
Get a result with.ResultInterface
getValueTemplate(SessionLocal session)
Get an empty result with the column names set.boolean
isDeterministic()
Whether the function always returns the same result for the same parameters.void
optimize(SessionLocal session)
Try to optimize this table function-
Methods inherited from class org.h2.expression.function.table.TableFunction
addParameter, doneWithParameters
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.h2.util.HasSQL
getSQL, getTraceSQL
-
-
-
-
Field Detail
-
functionAlias
private final FunctionAlias functionAlias
-
javaMethod
private final FunctionAlias.JavaMethod javaMethod
-
-
Constructor Detail
-
JavaTableFunction
public JavaTableFunction(FunctionAlias functionAlias, Expression[] args)
-
-
Method Detail
-
getValue
public ResultInterface getValue(SessionLocal session)
Description copied from class:TableFunction
Get a result with.- Specified by:
getValue
in classTableFunction
- Parameters:
session
- the session- Returns:
- the result
-
getValueTemplate
public ResultInterface getValueTemplate(SessionLocal session)
Description copied from class:TableFunction
Get an empty result with the column names set.- Specified by:
getValueTemplate
in classTableFunction
- Parameters:
session
- the session- Returns:
- the empty result
-
optimize
public void optimize(SessionLocal session)
Description copied from class:TableFunction
Try to optimize this table function- Overrides:
optimize
in classTableFunction
- Parameters:
session
- the session
-
getSQL
public java.lang.StringBuilder getSQL(java.lang.StringBuilder builder, int sqlFlags)
Description copied from interface:HasSQL
Appends the SQL statement of this object to the specified builder.- Specified by:
getSQL
in interfaceHasSQL
- Overrides:
getSQL
in classTableFunction
- Parameters:
builder
- string buildersqlFlags
- formatting flags- Returns:
- the specified string builder
-
getName
public java.lang.String getName()
Description copied from interface:NamedExpression
Get the name.- Returns:
- the name in uppercase
-
isDeterministic
public boolean isDeterministic()
Description copied from class:TableFunction
Whether the function always returns the same result for the same parameters.- Specified by:
isDeterministic
in classTableFunction
- Returns:
- true if it does
-
-