- All Superinterfaces:
is.codion.common.model.condition.TableConditionModel<is.codion.framework.domain.entity.attribute.Attribute<?>>
public interface EntityConditionModel
extends is.codion.common.model.condition.TableConditionModel<is.codion.framework.domain.entity.attribute.Attribute<?>>
Factory for
EntityConditionModel instances via
entityConditionModel(EntityType, EntityConnectionProvider)-
Nested Class Summary
Nested classes/interfaces inherited from interface is.codion.common.model.condition.TableConditionModel
is.codion.common.model.condition.TableConditionModel.ConditionModelFactory<C extends Object> -
Method Summary
Modifier and TypeMethodDescription<T> is.codion.common.model.condition.ConditionModel<T>attribute(is.codion.framework.domain.entity.attribute.Attribute<T> attribute) Returns theConditionModelassociated with the given attribute.is.codion.framework.db.EntityConnectionProviderstatic EntityConditionModelentityConditionModel(is.codion.framework.domain.entity.EntityType entityType, is.codion.framework.db.EntityConnectionProvider connectionProvider) Creates a newEntityConditionModelstatic EntityConditionModelentityConditionModel(is.codion.framework.domain.entity.EntityType entityType, is.codion.framework.db.EntityConnectionProvider connectionProvider, is.codion.common.model.condition.TableConditionModel.ConditionModelFactory<is.codion.framework.domain.entity.attribute.Attribute<?>> conditionModelFactory) Creates a newEntityConditionModelis.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> booleansetEqualOperand(is.codion.framework.domain.entity.attribute.Attribute<T> attribute, T operand) Sets the EQUAL condition operand of the condition model associated withattribute.<T> booleansetInOperands(is.codion.framework.domain.entity.attribute.Attribute<T> attribute, Collection<T> operands) Sets the IN condition operands 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.condition.TableConditionModel
changed, clear, enabled, get, get, optional
-
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
-
setEqualOperand
<T> boolean setEqualOperand(is.codion.framework.domain.entity.attribute.Attribute<T> attribute, T operand) Sets the EQUAL condition operand of the condition model associated withattribute. Enables the condition model in caseoperandis non-empty or disables it ifoperandis 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
<T> boolean setInOperands(is.codion.framework.domain.entity.attribute.Attribute<T> attribute, Collection<T> operands) Sets the IN condition operands of the condition model associated withattribute. Enables the condition model in caseoperandsis non-empty or disables it ifoperandsis 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
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
-
attribute
<T> is.codion.common.model.condition.ConditionModel<T> attribute(is.codion.framework.domain.entity.attribute.Attribute<T> attribute) Returns theConditionModelassociated with the given attribute.- Type Parameters:
T- the column value type- Parameters:
attribute- the attribute for which to retrieve theConditionModel- Returns:
- the
ConditionModelassociated withattribute - Throws:
IllegalArgumentException- in case no condition model exists for the given attribute
-
entityConditionModel
static EntityConditionModel entityConditionModel(is.codion.framework.domain.entity.EntityType entityType, is.codion.framework.db.EntityConnectionProvider connectionProvider) Creates a newEntityConditionModel- Parameters:
entityType- the underlying entity typeconnectionProvider- a EntityConnectionProvider instance- Returns:
- a new
EntityConditionModelinstance
-
entityConditionModel
static EntityConditionModel entityConditionModel(is.codion.framework.domain.entity.EntityType entityType, is.codion.framework.db.EntityConnectionProvider connectionProvider, is.codion.common.model.condition.TableConditionModel.ConditionModelFactory<is.codion.framework.domain.entity.attribute.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
EntityConditionModelinstance
-