public interface EntitySearchModel
Searches for entities based on a search text and set of String based condition columns.
Factory for
EntitySearchModel.Builder
instances via builder(EntityType, EntityConnectionProvider)
.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
A builder for aEntitySearchModel
.static interface
Controls the selectionstatic interface
Column search settings -
Field Summary
Modifier and TypeFieldDescriptionstatic final PropertyValue<Integer>
Specifies the default search result limit, that is, the maximum number of results, null meaning no limit Value type: Integer Default value: null -
Method Summary
Modifier and TypeMethodDescriptionstatic EntitySearchModel.Builder
builder
(EntityType entityType, EntityConnectionProvider connectionProvider) Instantiates a newEntitySearchModel.Builder
, initialized with the search columns for the given entity typecolumns()
Sets the additional search condition supplier to use when performing the next search.limit()
void
reset()
Resets the search string so that is represents the selected entitiessearch()
Performs a query based on the current search configuration and returns the result.settings()
boolean
Note that changing this value does not change the search string accordingly.
-
Field Details
-
DEFAULT_LIMIT
Specifies the default search result limit, that is, the maximum number of results, null meaning no limit- Value type: Integer
- Default value: null
-
-
Method Details
-
entityType
EntityType entityType()- Returns:
- the type of the entity this search model is based on
-
connectionProvider
EntityConnectionProvider connectionProvider()- Returns:
- the connection provider used by this search model
-
selection
EntitySearchModel.Selection selection()- Returns:
- the selection
-
description
String description()- Returns:
- a string describing this search model, by default a comma separated list of search column names
-
columns
Collection<Column<String>> columns()- Returns:
- the columns used when performing a search
-
reset
void reset()Resets the search string so that is represents the selected entities -
limit
- Returns:
- the
Value
controlling the search result limit
-
search
Performs a query based on the current search configuration and returns the result. Note that the number of search results may be limited vialimit()
.- Returns:
- a list containing the entities fulfilling the current condition
- Throws:
IllegalStateException
- in case no search columns are specified- See Also:
-
condition
Sets the additional search condition supplier to use when performing the next search. This condition is AND'ed to the actual search condition. NOTE, this does not affect the currently selected value(s), if any.- Returns:
- the
Value
controlling the additional condition supplier
-
stringFunction
Note that changing this value does not change the search string accordingly. -
searchStringModified
StateObserver searchStringModified()- Returns:
- a
StateObserver
indicating whether the search string represents the selected entities
-
settings
Map<Column<String>,EntitySearchModel.Settings> settings()- Returns:
- the settings associated with each search column
-
searchString
- Returns:
- the Value representing the search string
-
separator
- Returns:
- the Value representing the text used to separate multiple entities
-
singleSelection
boolean singleSelection()- Returns:
- true if single selection is enabled
-
builder
static EntitySearchModel.Builder builder(EntityType entityType, EntityConnectionProvider connectionProvider) Instantiates a newEntitySearchModel.Builder
, initialized with the search columns for the given entity type- Parameters:
entityType
- the type of the entity to searchconnectionProvider
- the EntityConnectionProvider to use when performing the search- Returns:
- a new
EntitySearchModel.Builder
instance - See Also:
-