Class CriteriaQuery

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 Details

  • Method Details

    • getFetchSize

      public int getFetchSize()
      Description copied from interface: SelectQuery
      Returns the fetch size for this query.
      Specified by:
      getFetchSize in interface SelectQuery
      Returns:
      the fetch size
    • setFetchSize

      public void setFetchSize(int fetchSize)
    • getMaxRows

      public int getMaxRows()
      Description copied from interface: SelectQuery
      Returns the maximum number of rows to be returned.
      Specified by:
      getMaxRows in interface SelectQuery
      Returns:
      the maximum number of rows
    • setMaxRows

      public void setMaxRows(int maxRows)
    • getQueryTimeout

      public int getQueryTimeout()
      Description copied from interface: Query
      Returns the query timeout in seconds.
      Specified by:
      getQueryTimeout in interface Query
      Returns:
      the query timeout
    • setQueryTimeout

      public void setQueryTimeout(int queryTimeout)
    • getSql

      public PreparedSql getSql()
      Description copied from interface: SelectQuery
      Returns the prepared SQL for this select query.
      Specified by:
      getSql in interface ModifyQuery
      Specified by:
      getSql in interface Query
      Specified by:
      getSql in interface SelectQuery
      Returns:
      the prepared SQL
    • getClassName

      public String getClassName()
      Description copied from interface: Query
      Returns the class name where the query is defined.
      Specified by:
      getClassName in interface Query
      Returns:
      the class name
    • getMethodName

      public String getMethodName()
      Description copied from interface: Query
      Returns the method name where the query is defined.
      Specified by:
      getMethodName in interface Query
      Returns:
      the method name
    • getMethod

      public Method getMethod()
      Description copied from interface: Query
      Returns the method object where the query is defined.
      Specified by:
      getMethod in interface Query
      Returns:
      the method object
    • getConfig

      public Config getConfig()
      Description copied from interface: Query
      Returns the configuration for this query.
      Specified by:
      getConfig in interface Query
      Returns:
      the configuration
    • prepare

      public void prepare()
      Description copied from interface: Query
      Prepares this query for execution. This method must be called before the query is executed.
      Specified by:
      prepare in interface Query
    • complete

      public void complete()
      Description copied from interface: Query
      Completes this query after execution. This method must be called after the query is executed.
      Specified by:
      complete in interface Query
    • comment

      public String comment(String sql)
      Description copied from interface: Query
      Adds a comment to the SQL statement.
      Specified by:
      comment in interface Query
      Parameters:
      sql - the SQL statement
      Returns:
      the SQL statement with the comment
    • getOptions

      public SelectOptions getOptions()
      Description copied from interface: SelectQuery
      Returns the options for this select query.
      Specified by:
      getOptions in interface SelectQuery
      Returns:
      the select options
    • isResultEnsured

      public boolean isResultEnsured()
      Description copied from interface: SelectQuery
      Returns whether the query is expected to return at least one result.
      Specified by:
      isResultEnsured in interface SelectQuery
      Returns:
      true if the query is expected to return at least one result
    • isResultMappingEnsured

      public boolean isResultMappingEnsured()
      Description copied from interface: SelectQuery
      Returns whether the result mapping is ensured.
      Specified by:
      isResultMappingEnsured in interface SelectQuery
      Returns:
      true if the result mapping is ensured
    • getFetchType

      public FetchType getFetchType()
      Description copied from interface: SelectQuery
      Returns the fetch type for this query.
      Specified by:
      getFetchType in interface SelectQuery
      Returns:
      the fetch type
    • getSqlLogType

      public SqlLogType getSqlLogType()
      Description copied from interface: SelectQuery
      Returns the SQL log type for this query.
      Specified by:
      getSqlLogType in interface ModifyQuery
      Specified by:
      getSqlLogType in interface SelectQuery
      Returns:
      the SQL log type
    • isResultStream

      public boolean isResultStream()
      Description copied from interface: SelectQuery
      Returns whether the result should be processed as a stream.
      Specified by:
      isResultStream in interface SelectQuery
      Returns:
      true if the result should be processed as a stream
    • incrementVersion

      public void incrementVersion()
      Description copied from interface: UpdateQuery
      Increments 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:
      incrementVersion in interface UpdateQuery
    • isOptimisticLockCheckRequired

      public boolean isOptimisticLockCheckRequired()
      Description copied from interface: ModifyQuery
      Returns whether optimistic lock checking is required for this query.
      Specified by:
      isOptimisticLockCheckRequired in interface ModifyQuery
      Returns:
      true if optimistic lock checking is required
    • isAutoGeneratedKeysSupported

      public boolean isAutoGeneratedKeysSupported()
      Description copied from interface: ModifyQuery
      Returns whether auto-generated keys are supported for this query.
      Specified by:
      isAutoGeneratedKeysSupported in interface ModifyQuery
      Returns:
      true if auto-generated keys are supported
    • isExecutable

      public boolean isExecutable()
      Description copied from interface: ModifyQuery
      Returns whether this query is executable.
      Specified by:
      isExecutable in interface ModifyQuery
      Returns:
      true if this query is executable
    • getSqlExecutionSkipCause

      public SqlExecutionSkipCause getSqlExecutionSkipCause()
      Description copied from interface: ModifyQuery
      Returns the cause if SQL execution should be skipped.
      Specified by:
      getSqlExecutionSkipCause in interface ModifyQuery
      Returns:
      the cause of SQL execution skip, or null if execution should not be skipped
    • generateId

      public void generateId(Statement statement)
      Description copied from interface: InsertQuery
      Generates 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:
      generateId in interface InsertQuery
      Parameters:
      statement - the statement used for the INSERT operation