java.lang.Object
org.seasar.doma.jdbc.SelectOptions
- All Implemented Interfaces:
Serializable
The options for an SQL SELECT statement.
SelectOptions options = SelectOptions.get().offset(10).limit(50).forUpdate();
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String[]protected booleanprotected longprotected SelectForUpdateTypeprotected longprotected longprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncount()Indicates to count all rows.Indicates to apply pessimistic locking.Indicates to apply pessimistic locking with specified aliases.Indicates to apply no-wait pessimistic locking.forUpdateNowait(String... aliases) Indicates to apply no-wait pessimistic locking with specified aliases.forUpdateWait(int waitSeconds) Indicates to apply pessimistic locking with specified wait seconds.forUpdateWait(int waitSeconds, String... aliases) Indicates to apply pessimistic locking with specified wait seconds and aliases.static SelectOptionsget()Creates a newSelectOptionsinstance.longgetCount()Returns the count of all rows.limit(int limit) Indicates to apply the specified limit.offset(int offset) Indicates to apply the the specified offset.
-
Field Details
-
offset
protected long offset -
limit
protected long limit -
count
protected boolean count -
countSize
protected long countSize -
forUpdateType
-
waitSeconds
protected int waitSeconds -
aliases
-
-
Constructor Details
-
SelectOptions
protected SelectOptions()
-
-
Method Details
-
get
Creates a newSelectOptionsinstance.- Returns:
- the new
SelectOptionsinstance
-
forUpdate
Indicates to apply pessimistic locking.- Returns:
- this instance
-
forUpdate
Indicates to apply pessimistic locking with specified aliases.- Parameters:
aliases- aliases of the table or the column- Returns:
- this instance
-
forUpdateNowait
Indicates to apply no-wait pessimistic locking.- Returns:
- the instance
-
forUpdateNowait
Indicates to apply no-wait pessimistic locking with specified aliases.- Parameters:
aliases- aliases of the table or the column- Returns:
- this instance
-
forUpdateWait
Indicates to apply pessimistic locking with specified wait seconds.- Parameters:
waitSeconds- the wait seconds- Returns:
- this instance
-
forUpdateWait
Indicates to apply pessimistic locking with specified wait seconds and aliases.- Parameters:
waitSeconds- the wait secondsaliases- aliases of the table or the column- Returns:
- this instance
-
offset
Indicates to apply the the specified offset.- Parameters:
offset- the offset- Returns:
- this instance
-
limit
Indicates to apply the specified limit.- Parameters:
limit- the limit- Returns:
- this instance
-
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
-