java.lang.Object
org.seasar.doma.jdbc.criteria.query.CriteriaQuery
- All Implemented Interfaces:
DeleteQuery,InsertQuery,ModifyQuery,Query,SelectQuery,UpdateQuery
public class CriteriaQuery
extends Object
implements SelectQuery, DeleteQuery, InsertQuery, UpdateQuery
-
Constructor Summary
ConstructorsConstructorDescriptionCriteriaQuery(Config config, PreparedSql sql, String className, String methodName) -
Method Summary
Modifier and TypeMethodDescriptionAdds a comment to the SQL statement.voidcomplete()Completes this query after execution.voidgenerateId(Statement statement) Generates an ID for the inserted row.Returns the class name where the query is defined.Returns the configuration for this query.intReturns the fetch size for this query.Returns the fetch type for this query.intReturns the maximum number of rows to be returned.Returns the method object where the query is defined.Returns the method name where the query is defined.Returns the options for this select query.intReturns the query timeout in seconds.getSql()Returns the prepared SQL for this select query.Returns the cause if SQL execution should be skipped.Returns the SQL log type for this query.voidIncrements the version number for the entity being updated.booleanReturns whether auto-generated keys are supported for this query.booleanReturns whether this query is executable.booleanReturns whether optimistic lock checking is required for this query.booleanReturns whether the query is expected to return at least one result.booleanReturns whether the result mapping is ensured.booleanReturns whether the result should be processed as a stream.voidprepare()Prepares this query for execution.voidsetFetchSize(int fetchSize) voidsetMaxRows(int maxRows) voidsetQueryTimeout(int queryTimeout)
-
Constructor Details
-
CriteriaQuery
-
-
Method Details
-
getFetchSize
public int getFetchSize()Description copied from interface:SelectQueryReturns the fetch size for this query.- Specified by:
getFetchSizein interfaceSelectQuery- Returns:
- the fetch size
-
setFetchSize
public void setFetchSize(int fetchSize) -
getMaxRows
public int getMaxRows()Description copied from interface:SelectQueryReturns the maximum number of rows to be returned.- Specified by:
getMaxRowsin interfaceSelectQuery- Returns:
- the maximum number of rows
-
setMaxRows
public void setMaxRows(int maxRows) -
getQueryTimeout
public int getQueryTimeout()Description copied from interface:QueryReturns the query timeout in seconds.- Specified by:
getQueryTimeoutin interfaceQuery- Returns:
- the query timeout
-
setQueryTimeout
public void setQueryTimeout(int queryTimeout) -
getSql
Description copied from interface:SelectQueryReturns the prepared SQL for this select query.- Specified by:
getSqlin interfaceModifyQuery- Specified by:
getSqlin interfaceQuery- Specified by:
getSqlin interfaceSelectQuery- Returns:
- the prepared SQL
-
getClassName
Description copied from interface:QueryReturns the class name where the query is defined.- Specified by:
getClassNamein interfaceQuery- Returns:
- the class name
-
getMethodName
Description copied from interface:QueryReturns the method name where the query is defined.- Specified by:
getMethodNamein interfaceQuery- Returns:
- the method name
-
getMethod
Description copied from interface:QueryReturns the method object where the query is defined. -
getConfig
Description copied from interface:QueryReturns the configuration for this query. -
prepare
public void prepare()Description copied from interface:QueryPrepares this query for execution. This method must be called before the query is executed. -
complete
public void complete()Description copied from interface:QueryCompletes this query after execution. This method must be called after the query is executed. -
comment
Description copied from interface:QueryAdds a comment to the SQL statement. -
getOptions
Description copied from interface:SelectQueryReturns the options for this select query.- Specified by:
getOptionsin interfaceSelectQuery- Returns:
- the select options
-
isResultEnsured
public boolean isResultEnsured()Description copied from interface:SelectQueryReturns whether the query is expected to return at least one result.- Specified by:
isResultEnsuredin interfaceSelectQuery- Returns:
trueif the query is expected to return at least one result
-
isResultMappingEnsured
public boolean isResultMappingEnsured()Description copied from interface:SelectQueryReturns whether the result mapping is ensured.- Specified by:
isResultMappingEnsuredin interfaceSelectQuery- Returns:
trueif the result mapping is ensured
-
getFetchType
Description copied from interface:SelectQueryReturns the fetch type for this query.- Specified by:
getFetchTypein interfaceSelectQuery- Returns:
- the fetch type
-
getSqlLogType
Description copied from interface:SelectQueryReturns the SQL log type for this query.- Specified by:
getSqlLogTypein interfaceModifyQuery- Specified by:
getSqlLogTypein interfaceSelectQuery- Returns:
- the SQL log type
-
isResultStream
public boolean isResultStream()Description copied from interface:SelectQueryReturns whether the result should be processed as a stream.- Specified by:
isResultStreamin interfaceSelectQuery- Returns:
trueif the result should be processed as a stream
-
incrementVersion
public void incrementVersion()Description copied from interface:UpdateQueryIncrements the version number for the entity being updated.This method is called after executing the UPDATE statement to update the version number in the entity object, ensuring it matches the value in the database after the update. This is important for optimistic concurrency control.
- Specified by:
incrementVersionin interfaceUpdateQuery
-
isOptimisticLockCheckRequired
public boolean isOptimisticLockCheckRequired()Description copied from interface:ModifyQueryReturns whether optimistic lock checking is required for this query.- Specified by:
isOptimisticLockCheckRequiredin interfaceModifyQuery- Returns:
trueif optimistic lock checking is required
-
isAutoGeneratedKeysSupported
public boolean isAutoGeneratedKeysSupported()Description copied from interface:ModifyQueryReturns whether auto-generated keys are supported for this query.- Specified by:
isAutoGeneratedKeysSupportedin interfaceModifyQuery- Returns:
trueif auto-generated keys are supported
-
isExecutable
public boolean isExecutable()Description copied from interface:ModifyQueryReturns whether this query is executable.- Specified by:
isExecutablein interfaceModifyQuery- Returns:
trueif this query is executable
-
getSqlExecutionSkipCause
Description copied from interface:ModifyQueryReturns the cause if SQL execution should be skipped.- Specified by:
getSqlExecutionSkipCausein interfaceModifyQuery- Returns:
- the cause of SQL execution skip, or
nullif execution should not be skipped
-
generateId
Description copied from interface:InsertQueryGenerates an ID for the inserted row.This method is called after executing the INSERT statement to retrieve and set auto-generated keys or sequence values for the entity. It's typically used for primary key generation strategies like identity columns or sequences.
- Specified by:
generateIdin interfaceInsertQuery- Parameters:
statement- the statement used for the INSERT operation
-