Class SelectOptions

java.lang.Object
org.seasar.doma.jdbc.SelectOptions
All Implemented Interfaces:
Serializable

public class SelectOptions extends Object implements Serializable
The options for an SQL SELECT statement.
 SelectOptions options = SelectOptions.get().offset(10).limit(50).forUpdate();
 
See Also:
  • Field Details

    • offset

      protected long offset
    • limit

      protected long limit
    • count

      protected boolean count
    • countSize

      protected long countSize
    • forUpdateType

      protected SelectForUpdateType forUpdateType
    • waitSeconds

      protected int waitSeconds
    • aliases

      protected String[] aliases
  • Constructor Details

    • SelectOptions

      protected SelectOptions()
  • Method Details

    • get

      public static SelectOptions get()
      Creates a new SelectOptions instance.
      Returns:
      the new SelectOptions instance
    • forUpdate

      public SelectOptions forUpdate()
      Indicates to apply pessimistic locking.
      Returns:
      this instance
    • forUpdate

      public SelectOptions forUpdate(String... aliases)
      Indicates to apply pessimistic locking with specified aliases.
      Parameters:
      aliases - aliases of the table or the column
      Returns:
      this instance
    • forUpdateNowait

      public SelectOptions forUpdateNowait()
      Indicates to apply no-wait pessimistic locking.
      Returns:
      the instance
    • forUpdateNowait

      public SelectOptions forUpdateNowait(String... aliases)
      Indicates to apply no-wait pessimistic locking with specified aliases.
      Parameters:
      aliases - aliases of the table or the column
      Returns:
      this instance
    • forUpdateWait

      public SelectOptions forUpdateWait(int waitSeconds)
      Indicates to apply pessimistic locking with specified wait seconds.
      Parameters:
      waitSeconds - the wait seconds
      Returns:
      this instance
    • forUpdateWait

      public SelectOptions forUpdateWait(int waitSeconds, String... aliases)
      Indicates to apply pessimistic locking with specified wait seconds and aliases.
      Parameters:
      waitSeconds - the wait seconds
      aliases - aliases of the table or the column
      Returns:
      this instance
    • offset

      public SelectOptions offset(int offset)
      Indicates to apply the the specified offset.
      Parameters:
      offset - the offset
      Returns:
      this instance
    • limit

      public SelectOptions limit(int limit)
      Indicates to apply the specified limit.
      Parameters:
      limit - the limit
      Returns:
      this instance
    • count

      public SelectOptions count()
      Indicates to count all rows.
      Returns:
      this instance
    • getCount

      public long getCount()
      Returns the count of all rows.

      If count() is not invoked before the DAO method execution, this method returns -1.

      Returns:
      the count of all rows