class ComputePreparationId implements BaseUpgradeTaskTo_1_2_0_PE {

    @Override
    public void run() {

        final Stream<Preparation> preparations = repository.list(Preparation.class);
        preparations.forEach(p -> {
            // preparation needs to be removed first as its id will change
            repository.remove(p);

            // change the preparation id and save id
            p.setId(UUID.randomUUID().toString());
            repository.add(p);

            LOG.debug("preparation {} has a new id {}", p.getName(), p.getName());
        });
    }

}