OFunction

Interface that controls a database function, which you can in turn use in OrientDB SQL on the database or within your applications.

Using Functions

Functions in OrientDB are stored operations that you can call from the Console or through any of the database driver methods that use OrientDB SQL. OrientDB provides a number of functions by default and the user can define a series of additional functions as need. They are stored in the database as a series of OFunction instances accessible through OMetadata and the OFunctionLibrary.

In order to work with functions from your application, you first need to import the class into your code.

import com.orientechnologies.orient.core.metadata.function.OFunction;

Methods

Each function supports the following methods.

MethodReturn TypeDescription
getCode()StringRetrieves the function code
getId()ORIDRetrieves the function Record ID
getLanguage()StringRetrieves the name of the scripting language the function uses
getName()StringRetrieves the logical name of the function
getParameters()List<String>Retrieves the parameters available for use in the function code
isIdempotent()booleanDetermines whether the function performs idempotent queries or executes non-idempotent commands
setCode()OFunctionDefines the function code
setIdempotent()OFunctionDefines whether the function is idempotent or non-idempotent
setLanguage()OFunctionDefines the scripting language the function uses
setName()OFunctionDefines the logical name of the function
setParameters()OFunctionDefines the parameters available to the function code