Module is.codion.framework.db.core
Package is.codion.framework.db
Interface EntityConnection.Select.Builder
- Enclosing interface:
EntityConnection.Select
public static interface EntityConnection.Select.Builder
Builds a
EntityConnection.Select
.-
Method Summary
Modifier and TypeMethodDescriptionattributes
(Collection<? extends Attribute<?>> attributes) Sets the attributes to include in the query result.<T extends Attribute<?>>
EntityConnection.Select.Builderattributes
(T... attributes) Sets the attributes to include in the query result.build()
Marks the Select instance as a FOR UPDATE query, this means the resulting rows will be locked by the given connection until unlocked by running another (non-select for update) query on the same connection or performing an update.The HAVING condition.Sets theOrderBy
for this conditionqueryTimeout
(int queryTimeout) referenceDepth
(int referenceDepth) Limit the levels of foreign keys to fetchreferenceDepth
(ForeignKey foreignKey, int referenceDepth) Returns the depth limit for a specific foreign key traversal.
-
Method Details
-
orderBy
Sets theOrderBy
for this condition- Parameters:
orderBy
- theOrderBy
to use when applying this condition- Returns:
- this builder instance
-
limit
- Parameters:
limit
- the LIMIT to use for this condition, null for no limit- Returns:
- this builder instance
-
offset
- Parameters:
offset
- the OFFSET to use for this condition, null for no offset- Returns:
- this builder instance
-
forUpdate
EntityConnection.Select.Builder forUpdate()Marks the Select instance as a FOR UPDATE query, this means the resulting rows will be locked by the given connection until unlocked by running another (non-select for update) query on the same connection or performing an update. Note that marking this Select instance as for update, sets theEntityConnection.Select.referenceDepth()
to zero, which can then be modified by setting it after setting forUpdate.- Returns:
- this builder instance
-
referenceDepth
Limit the levels of foreign keys to fetch- Parameters:
referenceDepth
- the foreign key reference depth limit- Returns:
- this builder instance
-
referenceDepth
Returns the depth limit for a specific foreign key traversal.OptionalInt.empty()
means use the globalEntityConnection.Select.referenceDepth()
value0
means do not fetch the referenced entity-1
means unlimited depth
- Parameters:
foreignKey
- the foreign key- Returns:
- the number of levels of foreign key values to fetch for the given key
-
attributes
Sets the attributes to include in the query result. An empty array means all attributes should be included. Note that primary key attribute values are always included.- Type Parameters:
T
- the attribute type- Parameters:
attributes
- the attributes to include- Returns:
- this builder instance
-
attributes
Sets the attributes to include in the query result. An empty Collection means all attributes should be included. Note that primary key attribute values are always included.- Parameters:
attributes
- the attributes to include- Returns:
- this builder instance
-
queryTimeout
- Parameters:
queryTimeout
- the query timeout, 0 for no timeout- Returns:
- this builder instance
-
having
The HAVING condition. Note that this condition must be based on aggregate function columns- Parameters:
having
- the HAVING condition- Returns:
- this builder instance
- See Also:
-
build
EntityConnection.Select build()- Returns:
- a new
EntityConnection.Select
instance based on this builder
-