Interface SQLFunction

    • Method Detail

      • execute

        Object execute​(Object iThis,
                       Identifiable iCurrentRecord,
                       Object iCurrentResult,
                       Object[] iParams,
                       CommandContext iContext)
        Process a record.
        Parameters:
        iThis -
        iCurrentRecord - : current record
        iCurrentResult - TODO
        iParams - : function parameters, number is ensured to be within minParams and maxParams.
        iContext - : object calling this function
        Returns:
        function result, can be null. Special cases : can be null if function aggregate results, can be null if function filter results : this mean result is excluded
      • config

        void config​(Object[] configuredParameters)
        Configure the function.
        Parameters:
        configuredParameters -
      • aggregateResults

        boolean aggregateResults()
        A function can make calculation on several records before returning a result.

        Example of such function : sum, count, max, min ...

        The final result of the aggregation is obtained by calling getResult()

        Returns:
        true if function aggregate results
      • getName

        String getName()
        Function name, the name is used by the sql parser to identify a call this function.
        Returns:
        String , function name, never null or empty.
      • getSyntax

        String getSyntax()
        Returns a convenient SQL String representation of the function.

        Example :

          myFunction( param1, param2, [optionalParam3])
         

        This text will be used in exception messages.

        Returns:
        String , never null.
      • getResult

        Object getResult()
        Only called when function aggregates results after all records have been passed to the function.
        Returns:
        Aggregation result