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 interfaceProvides aEntitySearchModel.Builder.ConnectionStep -
Method Summary
Modifier and TypeMethodDescriptionattributes(Collection<Attribute<?>> attributes) build()The condition supplier may not return null, doing so will cause an exception when searching.filter(ForeignKey foreignKey, EntityComboBoxModel filterModel) Links the given combo box model representing foreign key entities to this search model so that selection in the foreign key model filters this model.filter(ForeignKey foreignKey, EntitySearchModel filterModel) Links the given search model representing foreign key entities to this search model so that selection in the foreign key model filters this model.Defaults toEntityDefinition.orderBy().persistenceAware(boolean persistenceAware) search(Collection<Column<String>> columns)
-
Method Details
-
search
- Parameters:
columns- the columns to search- Returns:
- this builder
- Throws:
IllegalArgumentException- in casecolumnsis empty or a column is not associated with the underlying entity
-
search
- Parameters:
columns- the columns to search- 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
-
filter
Links the given combo box model representing foreign key entities to this search model so that selection in the foreign key model filters this model.- Parameters:
foreignKey- the foreign keyfilterModel- the combo box model filtering this model- Returns:
- this builder instance
- See Also:
-
filter
Links the given search model representing foreign key entities to this search model so that selection in the foreign key model filters this model.- Parameters:
foreignKey- the foreign keyfilterModel- the search model filtering this model- Returns:
- this builder instance
- See Also:
-
orderBy
Defaults toEntityDefinition.orderBy().- Parameters:
orderBy- theOrderByto use when querying entities from the database- Returns:
- this builder
-
persistenceAware
- Parameters:
persistenceAware- controls whether this search model should respond to entity persistence events, by replacing the selected entity when updated and clearing it when deleted- Returns:
- this builder instance
- See Also:
-
limit
- Parameters:
limit- the search result limit, null for no limit- Returns:
- this builder
-
build
EntitySearchModel build()- Returns:
- a new
EntitySearchModelbased on this builder
-