Class QoQFunctionService

java.lang.Object
ortus.boxlang.runtime.jdbc.qoq.QoQFunctionService

public class QoQFunctionService extends Object
I handle executing functions in query of queries
  • 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 function
      function - The function to execute
      functionDef - The function definition
      returnType - The return type of the function
      requiredParams - 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 function
      function - The function to execute
      returnType - The return type of the function
      requiredParams - The number of required parameters
      context - 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 function
      function - The function to execute
      returnType - The return type of the function
      requiredParams - The number of required parameters
      context - 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 function
      function - The function to execute
      functionDef - The function definition
      returnType - The return type of the function
      requiredParams - The number of required parameters
    • register

      public static void register(QoQScalarFunctionDef functionDef)
      Register a custom aggregate function
      Parameters:
      functionDef - The function definition
    • register

      public static void register(QoQAggregateFunctionDef functionDef)
      Register a custom aggregate function
      Parameters:
      functionDef - The function definition
    • unregister

      public static void unregister(Key name)
      Unregister a function
      Parameters:
      name - The name of the function
    • getFunction

      public static QoQFunctionService.QoQFunction getFunction(Key name)
      Get a function by name
      Parameters:
      name - The name of the function
      Returns:
      The function