Module is.codion.framework.model
Package is.codion.framework.model
Interface EntityTableConditionModel
- All Superinterfaces:
is.codion.common.model.table.TableConditionModel<is.codion.framework.domain.entity.attribute.Attribute<?>>
public interface EntityTableConditionModel
extends is.codion.common.model.table.TableConditionModel<is.codion.framework.domain.entity.attribute.Attribute<?>>
This interface defines filtering functionality, which refers to showing/hiding entities already available
in a table model and searching functionality, which refers to configuring the underlying query,
which then needs to be re-run.
Factory for
Factory for
EntityTableConditionModel instances via
entityTableConditionModel(EntityType, EntityConnectionProvider, ColumnConditionModel.Factory)-
Method Summary
Modifier and TypeMethodDescriptionis.codion.common.value.Value<Supplier<is.codion.framework.domain.entity.condition.Condition>>Controls the additional having condition.is.codion.common.value.Value<Supplier<is.codion.framework.domain.entity.condition.Condition>>Controls the additional where condition.<T> is.codion.common.model.table.ColumnConditionModel<is.codion.framework.domain.entity.attribute.Attribute<?>,T> attributeModel(is.codion.framework.domain.entity.attribute.Attribute<T> attribute) Returns theColumnConditionModelassociated with the given attribute.is.codion.framework.db.EntityConnectionProviderstatic EntityTableConditionModelentityTableConditionModel(is.codion.framework.domain.entity.EntityType entityType, is.codion.framework.db.EntityConnectionProvider connectionProvider) Creates a newEntityTableConditionModelstatic EntityTableConditionModelentityTableConditionModel(is.codion.framework.domain.entity.EntityType entityType, is.codion.framework.db.EntityConnectionProvider connectionProvider, is.codion.common.model.table.ColumnConditionModel.Factory<is.codion.framework.domain.entity.attribute.Attribute<?>> conditionModelFactory) Creates a newEntityTableConditionModelis.codion.framework.domain.entity.EntityTypeis.codion.framework.domain.entity.condition.Conditionhaving(is.codion.common.Conjunction conjunction) Returns a HAVING condition based on enabled condition models which are based on aggregate function columns.<T> booleansetEqualConditionValue(is.codion.framework.domain.entity.attribute.Attribute<T> attribute, T value) Sets the EQUAL condition value of the condition model associated withattribute.<T> booleansetInConditionValues(is.codion.framework.domain.entity.attribute.Attribute<T> attribute, Collection<T> values) Sets the IN condition values of the condition model associated withattribute.is.codion.framework.domain.entity.condition.Conditionwhere(is.codion.common.Conjunction conjunction) Returns a WHERE condition based on enabled condition models which are based on non-aggregate function columns.Methods inherited from interface is.codion.common.model.table.TableConditionModel
clear, conditionChangedEvent, conditionModel, conditionModels, enabled, enabled
-
Method Details
-
entityType
is.codion.framework.domain.entity.EntityType entityType()- Returns:
- the type of the entity this table condition model is based on
-
connectionProvider
is.codion.framework.db.EntityConnectionProvider connectionProvider()- Returns:
- the connection provider
-
setEqualConditionValue
<T> boolean setEqualConditionValue(is.codion.framework.domain.entity.attribute.Attribute<T> attribute, T value) Sets the EQUAL condition value of the condition model associated withattribute. Enables the condition model in casevalueis non-empty or disables it ifvalues is empty.- Type Parameters:
T- the value type- Parameters:
attribute- the attributevalue- the search condition value- Returns:
- true if the search state changed as a result of this method call, false otherwise
-
setInConditionValues
<T> boolean setInConditionValues(is.codion.framework.domain.entity.attribute.Attribute<T> attribute, Collection<T> values) Sets the IN condition values of the condition model associated withattribute. Enables the condition model in casevalueis non-empty or disables it ifvalues is empty.- Type Parameters:
T- the value type- Parameters:
attribute- the attributevalues- the search condition values, an empty Collection for none- Returns:
- true if the search state changed as a result of this method call, false otherwise
-
where
is.codion.framework.domain.entity.condition.Condition where(is.codion.common.Conjunction conjunction) 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
is.codion.framework.domain.entity.condition.Condition having(is.codion.common.Conjunction conjunction) 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
-
additionalWhere
is.codion.common.value.Value<Supplier<is.codion.framework.domain.entity.condition.Condition>> additionalWhere()Controls the additional where condition. The condition supplier may return null in case of no condition.- Returns:
- the value controlling the additional where condition
-
additionalHaving
is.codion.common.value.Value<Supplier<is.codion.framework.domain.entity.condition.Condition>> additionalHaving()Controls the additional having condition. The condition supplier may return null in case of no condition.- Returns:
- the value controlling the additional having condition
-
attributeModel
<T> is.codion.common.model.table.ColumnConditionModel<is.codion.framework.domain.entity.attribute.Attribute<?>,T> attributeModel(is.codion.framework.domain.entity.attribute.Attribute<T> attribute) Returns theColumnConditionModelassociated with the given attribute.- Type Parameters:
T- the column value type- Parameters:
attribute- the attribute for which to retrieve theColumnConditionModel- Returns:
- the
ColumnConditionModelassociated withattribute - Throws:
IllegalArgumentException- in case no condition model exists for the given attribute
-
entityTableConditionModel
static EntityTableConditionModel entityTableConditionModel(is.codion.framework.domain.entity.EntityType entityType, is.codion.framework.db.EntityConnectionProvider connectionProvider) Creates a newEntityTableConditionModel- Parameters:
entityType- the underlying entity typeconnectionProvider- a EntityConnectionProvider instance- Returns:
- a new
EntityTableConditionModelinstance
-
entityTableConditionModel
static EntityTableConditionModel entityTableConditionModel(is.codion.framework.domain.entity.EntityType entityType, is.codion.framework.db.EntityConnectionProvider connectionProvider, is.codion.common.model.table.ColumnConditionModel.Factory<is.codion.framework.domain.entity.attribute.Attribute<?>> conditionModelFactory) Creates a newEntityTableConditionModel- Parameters:
entityType- the underlying entity typeconnectionProvider- a EntityConnectionProvider instanceconditionModelFactory- provides the column condition models for this table condition model- Returns:
- a new
EntityTableConditionModelinstance
-