java.lang.Object
org.seasar.doma.jdbc.query.AbstractQuery
org.seasar.doma.jdbc.query.AutoModuleQuery
- All Implemented Interfaces:
ModuleQuery,Query
- Direct Known Subclasses:
AutoFunctionQuery,AutoProcedureQuery
An abstract base class for queries that call database modules.
This class provides common functionality for queries that call database stored procedures and functions. It handles parameter binding, module name qualification, and SQL generation.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringThe catalog name of the module.protected booleanWhether quotes are required for identifiers.protected StringThe name of the module.protected final List<SqlParameter>The parameters for the module call.protected StringThe qualified name of the module.protected StringThe schema name of the module.protected CallableSqlThe callable SQL for this module query.protected SqlLogTypeThe SQL log type for this module query.Fields inherited from class org.seasar.doma.jdbc.query.AbstractQuery
callerClassName, callerMethodName, config, message, method, queryTimeout -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddParameter(SqlParameter parameter) Adds a parameter to this module query.voidcomplete()Completes this query after execution.Returns the qualified name of the database module.getSql()Returns the callable SQL for this module query.Returns the SQL log type for this module query.protected voidPrepares the options for this module query.protected voidPrepares the qualified name of the module.voidsetCatalogName(String catalogName) Sets the catalog name of the module.protected voidsetModuleName(String moduleName) Sets the name of the module.voidsetQuoteRequired(boolean isQuoteRequired) Sets whether quotes are required for identifiers.voidsetSchemaName(String schemaName) Sets the schema name of the module.voidsetSqlLogType(SqlLogType sqlLogType) Sets the SQL log type for this module query.Methods inherited from class org.seasar.doma.jdbc.query.AbstractQuery
comment, getClassName, getConfig, getMethod, getMethodName, getQueryTimeout, prepare, 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.Query
comment, getClassName, getConfig, getMethod, getMethodName, getQueryTimeout, prepare
-
Field Details
-
sql
The callable SQL for this module query. -
catalogName
The catalog name of the module. -
schemaName
The schema name of the module. -
moduleName
The name of the module. -
qualifiedName
The qualified name of the module. -
isQuoteRequired
protected boolean isQuoteRequiredWhether quotes are required for identifiers. -
parameters
The parameters for the module call. -
sqlLogType
The SQL log type for this module query.
-
-
Constructor Details
-
AutoModuleQuery
public AutoModuleQuery()
-
-
Method Details
-
prepareQualifiedName
protected void prepareQualifiedName()Prepares the qualified name of the module.This method builds the fully qualified name of the module using catalog, schema, and module names, applying quotes if required.
-
prepareOptions
protected void prepareOptions()Prepares the options for this module query.This method sets default values for query timeout if not already set.
-
complete
public void complete()Completes this query after execution. This method must be called after the query is executed. -
setCatalogName
Sets the catalog name of the module.- Parameters:
catalogName- the catalog name
-
setSchemaName
Sets the schema name of the module.- Parameters:
schemaName- the schema name
-
setModuleName
Sets the name of the module.- Parameters:
moduleName- the module name
-
setQuoteRequired
public void setQuoteRequired(boolean isQuoteRequired) Sets whether quotes are required for identifiers.- Parameters:
isQuoteRequired-trueif quotes are required
-
setSqlLogType
Sets the SQL log type for this module query.- Parameters:
sqlLogType- the SQL log type
-
addParameter
Adds a parameter to this module query.- Parameters:
parameter- the parameter to add
-
getQualifiedName
Returns the qualified name of the database module.- Specified by:
getQualifiedNamein interfaceModuleQuery- Returns:
- the qualified name
-
getSql
Returns the callable SQL for this module query.- Specified by:
getSqlin interfaceModuleQuery- Specified by:
getSqlin interfaceQuery- Returns:
- the callable SQL
-
getSqlLogType
Returns the SQL log type for this module query.- Specified by:
getSqlLogTypein interfaceModuleQuery- Returns:
- the SQL log type
-