Module is.codion.framework.model
Package is.codion.framework.model
Class EntityConditionModelFactory
java.lang.Object
is.codion.framework.model.EntityConditionModelFactory
- All Implemented Interfaces:
Supplier<Map<Attribute<?>,
ConditionModel<?>>>
- Direct Known Subclasses:
SwingEntityConditionModelFactory
public class EntityConditionModelFactory
extends Object
implements Supplier<Map<Attribute<?>,ConditionModel<?>>>
A default
ConditionModel
factory for Entity based condition models.-
Constructor Summary
ConstructorsConstructorDescriptionEntityConditionModelFactory
(EntityType entityType, EntityConnectionProvider connectionProvider) Instantiates a newEntityConditionModelFactory
. -
Method Summary
Modifier and TypeMethodDescriptionprotected <T> ConditionModel
<T> conditionModel
(Column<T> column) Only called ifinclude(Column)
returns trueprotected ForeignKeyConditionModel
conditionModel
(ForeignKey foreignKey) Only called ifinclude(ForeignKey)
returns trueprotected final EntityConnectionProvider
protected EntitySearchModel
createEqualSearchModel
(ForeignKey foreignKey) protected EntitySearchModel
createInSearchModel
(ForeignKey foreignKey) protected final EntityDefinition
protected final EntityDefinition
definition
(EntityType entityType) final Map
<Attribute<?>, ConditionModel<?>> get()
protected boolean
protected boolean
include
(ForeignKey foreignKey)
-
Constructor Details
-
EntityConditionModelFactory
public EntityConditionModelFactory(EntityType entityType, EntityConnectionProvider connectionProvider) Instantiates a newEntityConditionModelFactory
.- Parameters:
entityType
- the entity typeconnectionProvider
- the connection provider
-
-
Method Details
-
get
- Specified by:
get
in interfaceSupplier<Map<Attribute<?>,
ConditionModel<?>>>
-
include
- Parameters:
column
- the column- Returns:
- true if a condition model should be included for the given column
-
include
- Parameters:
foreignKey
- the foreign key- Returns:
- true if a condition model should be included for the given foreign key
-
conditionModel
Only called ifinclude(Column)
returns true- Type Parameters:
T
- the column type- Parameters:
column
- the column- Returns:
- a
ConditionModel
based on the given column
-
conditionModel
Only called ifinclude(ForeignKey)
returns true- Parameters:
foreignKey
- the foreign key- Returns:
- a
ForeignKeyConditionModel
based on the given foreign key
-
createEqualSearchModel
- Parameters:
foreignKey
- the foreign key- Returns:
- a search model to use for the equal value
-
createInSearchModel
- Parameters:
foreignKey
- the foreign key- Returns:
- a search model to use for the in values
-
connectionProvider
- Returns:
- the underlying connection provider
-
definition
- Returns:
- the underlying
EntityDefinition
-
definition
- Parameters:
entityType
- the entity type- Returns:
- the definition of the given type
-