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()
void
clear()
Clears the search state of all non-persistant condition models, disables them and resets the operator to the inital one.enabled()
static EntityTableConditionModel
entityTableConditionModel
(EntityType entityType, EntityConnectionProvider connectionProvider) Creates a newEntityTableConditionModel
static EntityTableConditionModel
entityTableConditionModel
(EntityType entityType, EntityConnectionProvider connectionProvider, Supplier<Map<Attribute<?>, ConditionModel<?>>> conditionModelFactory) Creates a newEntityTableConditionModel
Map<Attribute<?>,
ConditionModel<?>> get()
<T> ConditionModel<T>
Returns theConditionModel
associated with the given column.get
(ForeignKey foreignKey) Returns theConditionModel
associated 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 withattribute
persist()
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 theConditionModel
associated with the given column.- Type Parameters:
T
- the column value type- Parameters:
column
- the column for which to retrieve theConditionModel
- Returns:
- the
ConditionModel
associated withcolumn
- Throws:
IllegalArgumentException
- in case no condition model exists for the given column
-
get
Returns theConditionModel
associated with the given foreignKey.- Parameters:
foreignKey
- the foreignKey for which to retrieve theConditionModel
- Returns:
- the
ConditionModel
associated 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
ConditionModel
for theattribute
or 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
ObservableState
enabled when any of the underlying condition models are enabled
-
changed
Observer<?> changed()- Returns:
- an observer notified each time the condition changes
-
persist
-
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
EntityTableConditionModel
instance
-
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
EntityTableConditionModel
instance
-