Package ortus.boxlang.runtime.jdbc.qoq
Class QoQFunctionService
java.lang.Object
ortus.boxlang.runtime.jdbc.qoq.QoQFunctionService
I handle executing functions in query of queries
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordRepresens a function and its definition -
Method Summary
Modifier and TypeMethodDescriptiongetFunction(Key name) Get a function by namestatic voidregister(QoQAggregateFunctionDef functionDef) Register a custom aggregate functionstatic voidregister(QoQScalarFunctionDef functionDef) Register a custom aggregate functionstatic voidregister(Key name, BiFunction<List<Object>, List<SQLExpression>, Object> function, IQoQFunctionDef functionDef, QueryColumnType returnType, int requiredParams) Register a scalar function via a BiFunctionstatic voidregisterAggregate(Key name, BiFunction<List<Object[]>, List<SQLExpression>, Object> function, IQoQFunctionDef functionDef, QueryColumnType returnType, int requiredParams) Register an aggregate function via a BiFunctionstatic voidregisterCustom(Key name, Function function, QueryColumnType returnType, int requiredParams, IBoxContext context) Register a custom function based on a UDF or closurestatic voidregisterCustomAggregate(Key name, Function function, QueryColumnType returnType, int requiredParams, IBoxContext context) Register a custom aggregate function based on a UDF or closurestatic voidunregister(Key name) Unregister a function
-
Method Details
-
register
public static void register(Key name, BiFunction<List<Object>, List<SQLExpression>, Object> function, IQoQFunctionDef functionDef, QueryColumnType returnType, int requiredParams) Register a scalar function via a BiFunction- Parameters:
name- The name of the functionfunction- The function to executefunctionDef- The function definitionreturnType- The return type of the functionrequiredParams- The number of required parameters
-
registerCustom
public static void registerCustom(Key name, Function function, QueryColumnType returnType, int requiredParams, IBoxContext context) Register a custom function based on a UDF or closure- Parameters:
name- The name of the functionfunction- The function to executereturnType- The return type of the functionrequiredParams- The number of required parameterscontext- The context to execute the function in
-
registerCustomAggregate
public static void registerCustomAggregate(Key name, Function function, QueryColumnType returnType, int requiredParams, IBoxContext context) Register a custom aggregate function based on a UDF or closure- Parameters:
name- The name of the functionfunction- The function to executereturnType- The return type of the functionrequiredParams- The number of required parameterscontext- The context to execute the function in
-
registerAggregate
public static void registerAggregate(Key name, BiFunction<List<Object[]>, List<SQLExpression>, Object> function, IQoQFunctionDef functionDef, QueryColumnType returnType, int requiredParams) Register an aggregate function via a BiFunction- Parameters:
name- The name of the functionfunction- The function to executefunctionDef- The function definitionreturnType- The return type of the functionrequiredParams- The number of required parameters
-
register
Register a custom aggregate function- Parameters:
functionDef- The function definition
-
register
Register a custom aggregate function- Parameters:
functionDef- The function definition
-
unregister
Unregister a function- Parameters:
name- The name of the function
-
getFunction
Get a function by name- Parameters:
name- The name of the function- Returns:
- The function
-