java.lang.Object
org.seasar.doma.jdbc.query.AbstractQuery
- All Implemented Interfaces:
Query
- Direct Known Subclasses:
AbstractCreateQuery,AbstractSelectQuery,AutoBatchModifyQuery,AutoModifyQuery,AutoModuleQuery,SqlBatchModifyQuery,SqlFileBatchModifyQuery,SqlFileModifyQuery,SqlFileScriptQuery,SqlModifyQuery,SqlProcessorQuery
The base abstract class for all query implementations.
This class provides common functionality for all query types.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringThe class name of the caller.protected StringThe method name of the caller.protected ConfigThe configuration.protected StringThe message to be included in SQL comments.protected MethodThe method that defines the query.protected intThe query timeout in seconds. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds a comment to the SQL statement.Returns the class name where the query is defined.Returns the configuration for this query.Returns the method object where the query is defined.Returns the method name where the query is defined.intReturns the query timeout in seconds.voidprepare()Prepares this query for execution.voidsetCallerClassName(String callerClassName) Sets the class name of the caller.voidsetCallerMethodName(String callerMethodName) Sets the method name of the caller.voidSets the configuration.voidsetMessage(String message) Sets the message to be included in SQL comments.voidSets the method that defines the query.voidsetQueryTimeout(int queryTimeout) Sets the query timeout in seconds.
-
Field Details
-
callerClassName
The class name of the caller. -
callerMethodName
The method name of the caller. -
config
The configuration. -
method
The method that defines the query. -
queryTimeout
protected int queryTimeoutThe query timeout in seconds. -
message
The message to be included in SQL comments.
-
-
Constructor Details
-
AbstractQuery
protected AbstractQuery()Creates a new instance.
-
-
Method Details
-
getClassName
Returns the class name where the query is defined.- Specified by:
getClassNamein interfaceQuery- Returns:
- the class name
-
setCallerClassName
Sets the class name of the caller.- Parameters:
callerClassName- the class name
-
getMethodName
Returns the method name where the query is defined.- Specified by:
getMethodNamein interfaceQuery- Returns:
- the method name
-
setCallerMethodName
Sets the method name of the caller.- Parameters:
callerMethodName- the method name
-
getConfig
Returns the configuration for this query. -
setConfig
Sets the configuration.- Parameters:
config- the configuration
-
getMethod
Returns the method object where the query is defined. -
setMethod
Sets the method that defines the query.- Parameters:
method- the method
-
getQueryTimeout
public int getQueryTimeout()Returns the query timeout in seconds.- Specified by:
getQueryTimeoutin interfaceQuery- Returns:
- the query timeout
-
setQueryTimeout
public void setQueryTimeout(int queryTimeout) Sets the query timeout in seconds.- Parameters:
queryTimeout- the query timeout
-
setMessage
Sets the message to be included in SQL comments.- Parameters:
message- the message
-
prepare
public void prepare()Prepares this query for execution. This method must be called before the query is executed. -
comment
Adds a comment to the SQL statement.
-