Class ClearFieldsTask

java.lang.Object
ch.tocco.nice2.optional.anonymization.impl.task.ClearFieldsTask
All Implemented Interfaces:
OptionalTask<Entity,Entity>, PersistTask<Entity,Entity>

public class ClearFieldsTask extends Object implements OptionalTask<Entity,Entity>
clears all non-mandatory fields on the given entity
  • Constructor Details

    • ClearFieldsTask

      public ClearFieldsTask()
  • Method Details

    • doRun

      public Entity doRun(Entity entity, CommandContext commandContext) throws Exception
      Specified by:
      doRun in interface OptionalTask<Entity,Entity>
      Throws:
      Exception
    • setIgnoreFields

      @Autowired public void setIgnoreFields(List<AnonymizeEntitiesIgnoreFieldContribution> contributions)
    • setClearFieldsToNull

      @Value("${nice2.optional.anonymization.clearFieldsToNull}") public void setClearFieldsToNull(boolean clearFieldsToNull)
      Set to true that nullable fields are null after clearing. Before, the empty value was set. However, if there was a number range and "0" was not allowed clearing was not possible. Also see TOCDEV-10754 for more details.