org.h2.engine

## Class FunctionAlias

- java.lang.Object
- - org.h2.engine.DbObjectBase
  - - org.h2.schema.SchemaObjectBase
    - - org.h2.engine.FunctionAlias

All Implemented Interfaces:
  DbObject, SchemaObject

    public class FunctionAlias
    extends SchemaObjectBase

Represents a user-defined function, or alias.

### Nested Class Summary

Nested Classes
`static class` `FunctionAlias.JavaMethod` There may be multiple Java methods that match a function name.

### Field Summary

### Fields inherited from class org.h2.engine.DbObjectBase

`comment, database, trace`

### Fields inherited from interface org.h2.engine.DbObject

`AGGREGATE, COMMENT, CONSTANT, CONSTRAINT, DOMAIN, FUNCTION_ALIAS, INDEX, RIGHT, ROLE, SCHEMA, SEQUENCE, SETTING, SYNONYM, TABLE_OR_VIEW, TRIGGER, USER`

### Method Summary

Methods
`void` `checkRename()` Check if this object can be renamed.
`FunctionAlias.JavaMethod` `findJavaMethod(Expression[] args)` Find the Java method that matches the arguments.
`java.lang.String` `getCreateSQL()` Build a SQL statement to re-create this object.
`java.lang.String` `getCreateSQLForCopy(Table table, java.lang.String quotedName)` Build a SQL statement to re-create the object, or to create a copy of the object with a different name or referencing a different table
`java.lang.String` `getDropSQL()` Build a SQL statement to drop this object.
`java.lang.String` `getJavaClassName()`
`java.lang.String` `getJavaMethodName()`
`FunctionAlias.JavaMethod[]` `getJavaMethods()` Get the Java methods mapped by this function.
`java.lang.String` `getSource()`
`java.lang.StringBuilder` `getSQL(java.lang.StringBuilder builder, boolean alwaysQuote)` Appends the SQL name of this object (may be quoted) to the specified builder.
`int` `getType()` Get the object type.
`boolean` `isDeterministic()`
`static FunctionAlias` `newInstance(Schema schema, int id, java.lang.String name, java.lang.String javaClassMethod, boolean force)` Create a new alias based on a method name.
`static FunctionAlias` `newInstanceFromSource(Schema schema, int id, java.lang.String name, java.lang.String source, boolean force)` Create a new alias based on source code.
`void` `removeChildrenAndResources(Session session)` Remove all dependent objects and free all resources (files, blocks in files) of this object.
`void` `setDeterministic(boolean deterministic)`

### Methods inherited from class org.h2.schema.SchemaObjectBase

`getSchema, getSQL, isHidden`

### Methods inherited from class org.h2.engine.DbObjectBase

`getChildren, getComment, getDatabase, getId, getModificationId, getName, invalidate, isTemporary, isValid, rename, setComment, setModified, setObjectName, setTemporary, toString`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.h2.engine.DbObject

`getChildren, getComment, getDatabase, getId, getName, isTemporary, rename, setComment, setTemporary`

### Method Detail

#### newInstance

    public static FunctionAlias newInstance(Schema schema,
                            int id,
                            java.lang.String name,
                            java.lang.String javaClassMethod,
                            boolean force)

Create a new alias based on a method name.

Parameters:
  `schema` - the schema
  `id` - the id
  `name` - the name
  `javaClassMethod` - the class and method name
  `force` - create the object even if the class or method does not exist
Returns:
  the database object

#### newInstanceFromSource

    public static FunctionAlias newInstanceFromSource(Schema schema,
                                      int id,
                                      java.lang.String name,
                                      java.lang.String source,
                                      boolean force)

Create a new alias based on source code.

Parameters:
  `schema` - the schema
  `id` - the id
  `name` - the name
  `source` - the source code
  `force` - create the object even if the class or method does not exist
Returns:
  the database object

#### getCreateSQLForCopy

    public java.lang.String getCreateSQLForCopy(Table table,
                                       java.lang.String quotedName)

Description copied from interface: `DbObject`
Build a SQL statement to re-create the object, or to create a copy of the object with a different name or referencing a different table

Parameters:
  `table` - the new table
  `quotedName` - the quoted name
Returns:
  the SQL statement

#### getDropSQL

    public java.lang.String getDropSQL()

Description copied from class: `DbObjectBase`
Build a SQL statement to drop this object.

Specified by:
  `getDropSQL` in interface `DbObject`
Specified by:
  `getDropSQL` in class `DbObjectBase`
Returns:
  the SQL statement

#### getSQL

    public java.lang.StringBuilder getSQL(java.lang.StringBuilder builder,
                                 boolean alwaysQuote)

Description copied from interface: `DbObject`
Appends the SQL name of this object (may be quoted) to the specified builder.

Specified by:
  `getSQL` in interface `DbObject`
Overrides:
  `getSQL` in class `SchemaObjectBase`
Parameters:
  `builder` - string builder
  `alwaysQuote` - quote all identifiers
Returns:
  the specified string builder

#### getCreateSQL

    public java.lang.String getCreateSQL()

Description copied from class: `DbObjectBase`
Build a SQL statement to re-create this object.

Specified by:
  `getCreateSQL` in interface `DbObject`
Specified by:
  `getCreateSQL` in class `DbObjectBase`
Returns:
  the SQL statement

#### getType

    public int getType()

Description copied from interface: `DbObject`
Get the object type.

Returns:
  the object type

#### removeChildrenAndResources

    public void removeChildrenAndResources(Session session)

Description copied from class: `DbObjectBase`
Remove all dependent objects and free all resources (files, blocks in files) of this object.

Specified by:
  `removeChildrenAndResources` in interface `DbObject`
Specified by:
  `removeChildrenAndResources` in class `DbObjectBase`
Parameters:
  `session` - the session

#### checkRename

    public void checkRename()

Description copied from class: `DbObjectBase`
Check if this object can be renamed. System objects may not be renamed.

Specified by:
  `checkRename` in interface `DbObject`
Specified by:
  `checkRename` in class `DbObjectBase`

#### findJavaMethod

    public FunctionAlias.JavaMethod findJavaMethod(Expression[] args)

Find the Java method that matches the arguments.

Parameters:
  `args` - the argument list
Returns:
  the Java method
Throws:
  `DbException` - if no matching method could be found

#### getJavaClassName

    public java.lang.String getJavaClassName()

#### getJavaMethodName

    public java.lang.String getJavaMethodName()

#### getJavaMethods

    public FunctionAlias.JavaMethod[] getJavaMethods()

Get the Java methods mapped by this function.

Returns:
  the Java methods.

#### setDeterministic

    public void setDeterministic(boolean deterministic)

#### isDeterministic

    public boolean isDeterministic()

#### getSource

    public java.lang.String getSource()