Interface EntityDefaultValueService
- All Known Implementing Classes:
EntityDefaultValueServiceImpl
public interface EntityDefaultValueService
-
Method Summary
Modifier and TypeMethodDescriptiondefault OptionalTask
<Entity, Entity> getBufferedSetEntityDefaultsTask
(String entityModel) Get OptionalTask that sets entity defaults but loads them only once.getDefaultEntitiesForRelation
(RelationModel relationModel) getDefaultValueForField
(FieldModel fieldModel) Evaluates and returns the default value for the passed field model if available.getDefaultValuesForRelation
(RelationModel relationModel) Evaluates and returns the default values for the passed relation model asSet
with primary keys as string if available.getSetEntityDefaultsTask
(boolean setNonNullableToEmpty) Get OptionalTask that sets entity defaults on an entity and returns it.void
setEntityDefaults
(Entity entity) Sets the default values for fields and relations, but only where those fields and relations were not touched already (are null for fields and empty for relations).
-
Method Details
-
setEntityDefaults
Sets the default values for fields and relations, but only where those fields and relations were not touched already (are null for fields and empty for relations). -
getSetEntityDefaultsTask
Get OptionalTask that sets entity defaults on an entity and returns it. If the parameter is true, non nullable fields will be set to empty after the default values have been set. (using the EntityModelUtils#setNonNullableToEmpty method) -
getBufferedSetEntityDefaultsTask
Get OptionalTask that sets entity defaults but loads them only once. A task that was created like this may only be used for entities of the model provided in the parameter and may result in faster entity creation if many entities of the same model are created. -
getDefaultValueForField
Evaluates and returns the default value for the passed field model if available. -
getDefaultValuesForRelation
Evaluates and returns the default values for the passed relation model asSet
with primary keys as string if available. -
getDefaultEntitiesForRelation
Same asgetDefaultValuesForRelation(RelationModel)
but returns anEntityList
instead of aSet
. If no default entities can be found an emptyEntityList
will be returned.
-