Class AutoFunctionQuery<RESULT>

Type Parameters:
RESULT - the type of the function result
All Implemented Interfaces:
FunctionQuery<RESULT>, ModuleQuery, Query

public class AutoFunctionQuery<RESULT> extends AutoModuleQuery implements FunctionQuery<RESULT>
An auto function query that calls a database function.

This class implements FunctionQuery to provide functionality for calling database functions. It handles parameter binding and result retrieval.

  • Field Details

    • resultParameter

      protected ResultParameter<RESULT> resultParameter
      The parameter that will hold the function result.
  • Constructor Details

    • AutoFunctionQuery

      public AutoFunctionQuery()
  • Method Details

    • prepare

      public void prepare()
      Prepares this query for execution. This method must be called before the query is executed.
      Specified by:
      prepare in interface Query
      Overrides:
      prepare in class AbstractQuery
    • prepareSql

      protected void prepareSql()
      Prepares the SQL for this function query.

      This method builds the callable SQL statement for the function call.

    • setFunctionName

      public void setFunctionName(String functionName)
      Sets the function name.
      Parameters:
      functionName - the function name
    • setResultParameter

      public void setResultParameter(ResultParameter<RESULT> parameter)
      Sets the result parameter.
      Parameters:
      parameter - the result parameter
    • getResult

      public RESULT getResult()
      Returns the result of the function call.

      This method is called after executing the function to retrieve the result value. The result type depends on the function's return type and the Java type mapping.

      Specified by:
      getResult in interface FunctionQuery<RESULT>
      Returns:
      the function result