| java.lang.Object org.hsqldb.Function
Function | class Function (Code) | | Provides services to evaluate SQL function and stored procedure calls,
by invoking Java methods.
Extended in successive versions of HSQLDB.
author: Thomas Mueller (Hypersonic SQL Group) version: 1.8.0 since: Hypersonic SQL |
Constructor Summary | |
| Function(String name, String fqn, boolean isSimple) Constructs a new Function object with the given function call name
and using the specified Session context. |
hasAggregate | boolean hasAggregate(Code) | | |
isSimple | boolean isSimple(Code) | | |
Function | Function(String name, String fqn, boolean isSimple) throws HsqlException(Code) | | Constructs a new Function object with the given function call name
and using the specified Session context.
The call name is the fully qualified name of a static Java method, in
the form "package.class.method." This implies that Java
methods with the same fully qualified name but different signatures
cannot be used properly as HSQLDB SQL functions or stored procedures.
For instance, it is impossible to call both System.getProperty(String)
and System.getProperty(String,String) under this arrangement, because
the HSQLDB Function object is unable to differentiate between the two;
it simply chooses the first method matching the FQN in the array of
methods obtained from calling getMethods() on an instance of the
Class indicated in the FQN, hiding all other methods with the same
FQN.
The function FQN must match at least one static Java method FQN in the
specified class or construction cannot procede and an HsqlException is
thrown.
The isSimple parameter is true when certain SQL standard functions
that are used without brackets are invokded.
Parameters: name - this Function object's call name Parameters: fqn - the fully qualified name of a Java method Parameters: isSimple - if true, used to evalate CURRENT_TIME, NOW etc.evaluate throws: HsqlException - if the specified function FQN corresponds to noJava method |
checkResolved | boolean checkResolved(boolean check) throws HsqlException(Code) | | Checks each of this object's arguments for resolution, throwing an
HsqlException if any arguments have not yet been resolved.
The check boolean argument is passed on to further check calls.
|
checkTables | void checkTables(HsqlArrayList fa) throws HsqlException(Code) | | Checks the Expresion parameters to this Function object against the
set of TableFilter.
|
describe | public String describe(Session session)(Code) | | Returns a String representation of this object.
|
getArgClass | Class getArgClass(int i)(Code) | | Returns the Java Class of the i'th argument.
|
getArgCount | int getArgCount()(Code) | | Returns the number of parameters that must be supplied to evaluate
this Function object from SQL.
This value may be different than the number of parameters of the
underlying Java method. This is because HSQLDB automatically detects
if the first parameter is of type java.sql.Connection, and supplies a
live Connection object constructed from the evaluating session context
if so.
|
getArgNullability | int getArgNullability(int i)(Code) | | Returns the SQL nullability code of the i'th argument.
|
getArgType | int getArgType(int i)(Code) | | Returns the type of the argument at the specified
offset in this Function object's paramter list.
|
getReturnClassName | String getReturnClassName()(Code) | | Returns the Java Class of the object returned by getValue().
|
getReturnType | int getReturnType()(Code) | | Returns the type of this Function
object's return type.
|
replaceAliases | void replaceAliases(Expression[] columns, int length) throws HsqlException(Code) | | Remnoves the Table filters from Expression parameters to this Function.
throws: HsqlException - if there is a problem resolving a parameteragainst the specified TableFilter |
resolveTables | void resolveTables(TableFilter f) throws HsqlException(Code) | | Resolves the Expression parameters to this Function object against the
specified TableFilter.
|
resolveType | void resolveType(Session session) throws HsqlException(Code) | | Resolves the type of this expression and performs certain
transformations and optimisations of the expression tree.
|
setArgument | void setArgument(int i, Expression e)(Code) | | Binds the specified expression to the specified position in this
Function object's parameter list.
|
|
|