Module is.codion.framework.model
Package is.codion.framework.model
Interface EntityTableConditionModel
public interface EntityTableConditionModel
Factory for
EntityTableConditionModel instances via
entityTableConditionModel(EntityType, EntityConnectionProvider)-
Method Summary
Modifier and TypeMethodDescriptionObserver<?> changed()voidclear()Clears the search state of all non-persistant condition models, disables them and resets the operator to the inital one.enabled()static EntityTableConditionModelentityTableConditionModel(EntityType entityType, EntityConnectionProvider connectionProvider) Creates a newEntityTableConditionModelstatic EntityTableConditionModelentityTableConditionModel(EntityType entityType, EntityConnectionProvider connectionProvider, Supplier<Map<Attribute<?>, ConditionModel<?>>> conditionModelFactory) Creates a newEntityTableConditionModelMap<Attribute<?>, ConditionModel<?>> get()<T> ConditionModel<T> Returns theConditionModelassociated with the given column.get(ForeignKey foreignKey) Returns theConditionModelassociated with the given foreignKey.having(Conjunction conjunction) Returns a HAVING condition based on enabled condition models which are based on aggregate function columns.<T> Optional<ConditionModel<T>> The condition model associated withattributepersist()where(Conjunction conjunction) Returns a WHERE condition based on enabled condition models which are based on non-aggregate function columns.
-
Method Details
-
entityType
EntityType entityType()- Returns:
- the type of the entity this table condition model is based on
-
connectionProvider
EntityConnectionProvider connectionProvider()- Returns:
- the connection provider
-
where
Returns a WHERE condition based on enabled condition models which are based on non-aggregate function columns.- Parameters:
conjunction- the conjunction to use in case of multiple enabled conditions- Returns:
- the current WHERE condition based on the state of the underlying condition models
-
having
Returns a HAVING condition based on enabled condition models which are based on aggregate function columns.- Parameters:
conjunction- the conjunction to use in case of multiple enabled conditions- Returns:
- the current HAVING condition based on the state of the underlying condition models
-
get
Map<Attribute<?>,ConditionModel<?>> get()- Returns:
- an unmodifiable view of the available condition models
-
get
Returns theConditionModelassociated with the given column.- Type Parameters:
T- the column value type- Parameters:
column- the column for which to retrieve theConditionModel- Returns:
- the
ConditionModelassociated withcolumn - Throws:
IllegalArgumentException- in case no condition model exists for the given column
-
get
Returns theConditionModelassociated with the given foreignKey.- Parameters:
foreignKey- the foreignKey for which to retrieve theConditionModel- Returns:
- the
ConditionModelassociated withforeignKey - Throws:
IllegalArgumentException- in case no condition model exists for the given foreignKey
-
optional
The condition model associated withattribute- Type Parameters:
T- the condition value type- Parameters:
attribute- the attribute for which to retrieve theConditionModel- Returns:
- the
ConditionModelfor theattributeor an empty Optional in case one is not available
-
clear
void clear()Clears the search state of all non-persistant condition models, disables them and resets the operator to the inital one.- See Also:
-
enabled
ObservableState enabled()- Returns:
- an
ObservableStateenabled when any of the underlying condition models are enabled
-
changed
Observer<?> changed()- Returns:
- an observer notified each time the condition changes
-
persist
- Returns:
- a
ValueSetcontrolling the identifiers of conditions which should persist when this condition model is cleared - See Also:
-
conditionModel
TableConditionModel<Attribute<?>> conditionModel()- Returns:
- the underlying
TableConditionModel
-
entityTableConditionModel
static EntityTableConditionModel entityTableConditionModel(EntityType entityType, EntityConnectionProvider connectionProvider) Creates a newEntityTableConditionModel- Parameters:
entityType- the underlying entity typeconnectionProvider- a EntityConnectionProvider instance- Returns:
- a new
EntityTableConditionModelinstance
-
entityTableConditionModel
static EntityTableConditionModel entityTableConditionModel(EntityType entityType, EntityConnectionProvider connectionProvider, Supplier<Map<Attribute<?>, ConditionModel<?>>> conditionModelFactory) Creates a newEntityTableConditionModel- Parameters:
entityType- the underlying entity typeconnectionProvider- a EntityConnectionProvider instanceconditionModelFactory- supplies the column condition models for this table condition model- Returns:
- a new
EntityTableConditionModelinstance
-