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 is.codion.framework.domain.entity.attribute.Attribute<?>> attributes) Sets the attributes to include in the query result.<T extends is.codion.framework.domain.entity.attribute.Attribute<?>>
EntityConnection.Select.Builderattributes(T... attributes) Sets the attributes to include in the query result.build()fetchDepth(int fetchDepth) Limit the levels of foreign keys to fetchfetchDepth(is.codion.framework.domain.entity.attribute.ForeignKey foreignKey, int fetchDepth) Limit the levels of foreign keys to fetch via the given foreign keyMarks 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.having(is.codion.framework.domain.entity.condition.Condition having) The HAVING condition.limit(int limit) offset(int offset) orderBy(is.codion.framework.domain.entity.OrderBy orderBy) Sets the OrderBy for this conditionqueryTimeout(int queryTimeout)
-
Method Details
-
orderBy
Sets the OrderBy for this condition- Parameters:
orderBy- the OrderBy to use when applying this condition- Returns:
- this builder instance
-
limit
- Parameters:
limit- the limit to use for this condition- Returns:
- this builder instance
-
offset
- Parameters:
offset- the offset to use for this condition- Returns:
- this builder instance
-
forUpdate
EntityConnection.Select.Builder forUpdate()Marks 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.fetchDepth()to zero, which can then be modified by setting it after setting forUpdate.- Returns:
- this builder instance
-
fetchDepth
Limit the levels of foreign keys to fetch- Parameters:
fetchDepth- the foreign key fetch depth limit- Returns:
- this builder instance
-
fetchDepth
EntityConnection.Select.Builder fetchDepth(is.codion.framework.domain.entity.attribute.ForeignKey foreignKey, int fetchDepth) Limit the levels of foreign keys to fetch via the given foreign key- Parameters:
foreignKey- the foreign keyfetchDepth- the foreign key fetch depth limit- Returns:
- this builder instance
-
attributes
<T extends is.codion.framework.domain.entity.attribute.Attribute<?>> EntityConnection.Select.Builder attributes(T... 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
EntityConnection.Select.Builder attributes(Collection<? extends is.codion.framework.domain.entity.attribute.Attribute<?>> 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
EntityConnection.Select.Builder having(is.codion.framework.domain.entity.condition.Condition 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:
-
ColumnDefinition.aggregate()
-
build
EntityConnection.Select build()- Returns:
- a new
EntityConnection.Selectinstance based on this builder
-