- All Known Subinterfaces:
BatchDeleteQuery,BatchInsertQuery,BatchModifyQuery,BatchUpdateQuery,CreateQuery<RESULT>,DeleteQuery,FunctionQuery<RESULT>,InsertQuery,ModifyQuery,ModuleQuery,ProcedureQuery,ScriptQuery,SelectQuery,UpdateQuery
- All Known Implementing Classes:
AbstractCreateQuery,AbstractQuery,AbstractSelectQuery,ArrayCreateQuery,AutoBatchDeleteQuery,AutoBatchInsertQuery,AutoBatchModifyQuery,AutoBatchUpdateQuery,AutoDeleteQuery,AutoFunctionQuery,AutoInsertQuery,AutoModifyQuery,AutoModuleQuery,AutoMultiInsertQuery,AutoProcedureQuery,AutoUpdateQuery,BlobCreateQuery,ClobCreateQuery,CountQuery,CriteriaQuery,NClobCreateQuery,SqlBatchDeleteQuery,SqlBatchInsertQuery,SqlBatchModifyQuery,SqlBatchUpdateQuery,SqlDeleteQuery,SqlFileBatchDeleteQuery,SqlFileBatchInsertQuery,SqlFileBatchModifyQuery,SqlFileBatchUpdateQuery,SqlFileDeleteQuery,SqlFileInsertQuery,SqlFileModifyQuery,SqlFileScriptQuery,SqlFileSelectQuery,SqlFileUpdateQuery,SqlInsertQuery,SqlModifyQuery,SqlProcessorQuery,SqlSelectQuery,SqlUpdateQuery,SQLXMLCreateQuery
public interface Query
The base interface for all query types.
This interface defines the common operations for all database queries in Doma.
-
Method Summary
Modifier and TypeMethodDescriptionAdds a comment to the SQL statement.voidcomplete()Completes this query after execution.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.Sql<?>getSql()Returns the SQL object that represents the query.voidprepare()Prepares this query for execution.
-
Method Details
-
getSql
Sql<?> getSql()Returns the SQL object that represents the query.- Returns:
- the SQL object
-
getClassName
String getClassName()Returns the class name where the query is defined.- Returns:
- the class name
-
getMethodName
String getMethodName()Returns the method name where the query is defined.- Returns:
- the method name
-
getMethod
Method getMethod()Returns the method object where the query is defined.- Returns:
- the method object
-
getConfig
Config getConfig()Returns the configuration for this query.- Returns:
- the configuration
-
getQueryTimeout
int getQueryTimeout()Returns the query timeout in seconds.- Returns:
- the query timeout
-
prepare
void prepare()Prepares this query for execution. This method must be called before the query is executed. -
complete
void complete()Completes this query after execution. This method must be called after the query is executed. -
comment
Adds a comment to the SQL statement.- Parameters:
sql- the SQL statement- Returns:
- the SQL statement with the comment
-