Interface EntityDefaultValueService

All Known Implementing Classes:
EntityDefaultValueServiceImpl

public interface EntityDefaultValueService
  • Method Details

    • setEntityDefaults

      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).
    • getSetEntityDefaultsTask

      OptionalTask<Entity,Entity> getSetEntityDefaultsTask(boolean setNonNullableToEmpty)
      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

      default OptionalTask<Entity,Entity> getBufferedSetEntityDefaultsTask(String entityModel)
      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

      default Optional<Object> getDefaultValueForField(FieldModel fieldModel)
      Evaluates and returns the default value for the passed field model if available.
    • getDefaultValuesForRelation

      default Set<String> getDefaultValuesForRelation(RelationModel relationModel)
      Evaluates and returns the default values for the passed relation model as Set with primary keys as string if available.
    • getDefaultEntitiesForRelation

      default List<Entity> getDefaultEntitiesForRelation(RelationModel relationModel)
      Same as getDefaultValuesForRelation(RelationModel) but returns an EntityList instead of a Set. If no default entities can be found an empty EntityList will be returned.