java.lang.Object
org.seasar.doma.jdbc.query.AbstractQuery
org.seasar.doma.jdbc.query.AutoModuleQuery
org.seasar.doma.jdbc.query.AutoFunctionQuery<RESULT>
- Type Parameters:
RESULT- the type of the function result
- All Implemented Interfaces:
FunctionQuery<RESULT>,ModuleQuery,Query
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 Summary
FieldsModifier and TypeFieldDescriptionprotected ResultParameter<RESULT>The parameter that will hold the function result.Fields inherited from class org.seasar.doma.jdbc.query.AutoModuleQuery
catalogName, isQuoteRequired, moduleName, parameters, qualifiedName, schemaName, sql, sqlLogTypeFields inherited from class org.seasar.doma.jdbc.query.AbstractQuery
callerClassName, callerMethodName, config, message, method, queryTimeout -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the result of the function call.voidprepare()Prepares this query for execution.protected voidPrepares the SQL for this function query.voidsetFunctionName(String functionName) Sets the function name.voidsetResultParameter(ResultParameter<RESULT> parameter) Sets the result parameter.Methods inherited from class org.seasar.doma.jdbc.query.AutoModuleQuery
addParameter, complete, getQualifiedName, getSql, getSqlLogType, prepareOptions, prepareQualifiedName, setCatalogName, setModuleName, setQuoteRequired, setSchemaName, setSqlLogTypeMethods inherited from class org.seasar.doma.jdbc.query.AbstractQuery
comment, getClassName, getConfig, getMethod, getMethodName, getQueryTimeout, setCallerClassName, setCallerMethodName, setConfig, setMessage, setMethod, setQueryTimeoutMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.seasar.doma.jdbc.query.ModuleQuery
getQualifiedName, getSql, getSqlLogTypeMethods inherited from interface org.seasar.doma.jdbc.query.Query
comment, complete, getClassName, getConfig, getMethod, getMethodName, getQueryTimeout
-
Field Details
-
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:
preparein interfaceQuery- Overrides:
preparein classAbstractQuery
-
prepareSql
protected void prepareSql()Prepares the SQL for this function query.This method builds the callable SQL statement for the function call.
-
setFunctionName
Sets the function name.- Parameters:
functionName- the function name
-
setResultParameter
Sets the result parameter.- Parameters:
parameter- the result parameter
-
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:
getResultin interfaceFunctionQuery<RESULT>- Returns:
- the function result
-