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.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceProvides aEntitySearchModel.Builderstatic interface -
Method Summary
Modifier and TypeMethodDescriptionattributes(Collection<Attribute<?>> attributes) build()The condition supplier may not return null, doing so will cause an exception when searching.editEvents(boolean editEvents) limit(int limit) Defaults toEntityDefinition.orderBy().searchColumns(Collection<Column<String>> searchColumns)
-
Method Details
-
searchColumns
- Parameters:
searchColumns- the columns to search by- Returns:
- this builder
- Throws:
IllegalArgumentException- in casecolumnsis 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- theOrderByto use when querying entities from the database- Returns:
- this builder
-
editEvents
- Parameters:
editEvents- 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
EntitySearchModelbased on this builder
-