- All Superinterfaces:
TableConditionModel<Attribute<?>>
Factory for
EntityConditionModel
instances via
entityConditionModel(EntityType, EntityConnectionProvider)
-
Nested Class Summary
Nested classes/interfaces inherited from interface is.codion.common.model.condition.TableConditionModel
TableConditionModel.ConditionModelFactory<C>
-
Method Summary
Modifier and TypeMethodDescription<T> ConditionModel<T>
Returns theConditionModel
associated with the given attribute.static EntityConditionModel
entityConditionModel
(EntityType entityType, EntityConnectionProvider connectionProvider) Creates a newEntityConditionModel
static EntityConditionModel
entityConditionModel
(EntityType entityType, EntityConnectionProvider connectionProvider, TableConditionModel.ConditionModelFactory<Attribute<?>> conditionModelFactory) Creates a newEntityConditionModel
having
(Conjunction conjunction) Returns a HAVING condition based on enabled condition models which are based on aggregate function columns.<T> boolean
setEqualOperand
(Attribute<T> attribute, T operand) Sets the EQUAL condition operand of the condition model associated withattribute
.<T> boolean
setInOperands
(Attribute<T> attribute, Collection<T> operands) Sets the IN condition operands of the condition model associated withattribute
.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
-
setEqualOperand
Sets the EQUAL condition operand of the condition model associated withattribute
. Enables the condition model in caseoperand
is non-empty or disables it ifoperand
is empty.- Type Parameters:
T
- the operand type- Parameters:
attribute
- the attributeoperand
- the search condition operand- Returns:
- true if the search state changed as a result of this method call, false otherwise
-
setInOperands
Sets the IN condition operands of the condition model associated withattribute
. Enables the condition model in caseoperands
is non-empty or disables it ifoperands
is empty.- Type Parameters:
T
- the value type- Parameters:
attribute
- the attributeoperands
- the search condition operands, an empty Collection for none- Returns:
- true if the search state changed as a result of this method call, false otherwise
-
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
-
attribute
Returns theConditionModel
associated with the given attribute.- Type Parameters:
T
- the column value type- Parameters:
attribute
- the attribute for which to retrieve theConditionModel
- Returns:
- the
ConditionModel
associated withattribute
- Throws:
IllegalArgumentException
- in case no condition model exists for the given attribute
-
entityConditionModel
static EntityConditionModel entityConditionModel(EntityType entityType, EntityConnectionProvider connectionProvider) Creates a newEntityConditionModel
- Parameters:
entityType
- the underlying entity typeconnectionProvider
- a EntityConnectionProvider instance- Returns:
- a new
EntityConditionModel
instance
-
entityConditionModel
static EntityConditionModel entityConditionModel(EntityType entityType, EntityConnectionProvider connectionProvider, TableConditionModel.ConditionModelFactory<Attribute<?>> conditionModelFactory) Creates a newEntityConditionModel
- Parameters:
entityType
- the underlying entity typeconnectionProvider
- a EntityConnectionProvider instanceconditionModelFactory
- provides the column condition models for this table condition model- Returns:
- a new
EntityConditionModel
instance
-