Module is.codion.framework.model
Package is.codion.framework.model
Interface EntitySearchModel.Builder
- Enclosing interface:
EntitySearchModel
public static interface EntitySearchModel.Builder
A builder for a
EntitySearchModel
.-
Method Summary
Modifier and TypeMethodDescriptionattributes
(Collection<Attribute<?>> attributes) build()
The condition supplier may not return null, doing so will cause an exception when searching.handleEditEvents
(boolean handleEditEvents) limit
(int limit) Defaults toEntityDefinition.orderBy()
.searchColumns
(Collection<Column<String>> searchColumns) singleSelection
(boolean singleSelection) Default false
-
Method Details
-
searchColumns
- Parameters:
searchColumns
- the columns to search by- Returns:
- this builder
- Throws:
IllegalArgumentException
- in casecolumns
is empty or a column is not associated with the underlying entity
-
condition
The condition supplier may not return null, doing so will cause an exception when searching.
- Parameters:
condition
- the additional condition supplier to use when performing the search- Returns:
- this builder instance
-
attributes
- Parameters:
attributes
- the attributes to include when querying entities from the database, an empty Collection means all- Returns:
- this builder
- Throws:
IllegalArgumentException
- in case an attribute is not associated with the underlying entity
-
orderBy
Defaults toEntityDefinition.orderBy()
.- Parameters:
orderBy
- theOrderBy
to use when querying entities from the database- Returns:
- this builder
-
singleSelection
Default false- Parameters:
singleSelection
- true if single selection should be enabled- Returns:
- this builder
-
handleEditEvents
- Parameters:
handleEditEvents
- controls whether this search model should handle entity edit events, by updating any updated items and removing deleted ones- Returns:
- this builder instance
- See Also:
-
limit
- Parameters:
limit
- the search result limit- Returns:
- this builder
-
build
EntitySearchModel build()- Returns:
- a new
EntitySearchModel
based on this builder
-