Exemplo n.º 1
0
 public void decorate(Resource resource, DecoratorContext context) {
   for (PastSnapshot projectPastSnapshot : projectPastSnapshots) {
     if (shouldComputeVariation(projectPastSnapshot.getMode(), resource)) {
       computeVariation(resource, context, projectPastSnapshot);
     }
   }
 }
 void persistConfiguration() {
   List<PastSnapshot> pastSnapshots = configuration.getProjectPastSnapshots();
   for (PastSnapshot pastSnapshot : pastSnapshots) {
     projectSnapshot = session.reattach(Snapshot.class, projectSnapshot.getId());
     projectSnapshot.setPeriodMode(pastSnapshot.getIndex(), pastSnapshot.getMode());
     projectSnapshot.setPeriodModeParameter(
         pastSnapshot.getIndex(), pastSnapshot.getModeParameter());
     projectSnapshot.setPeriodDate(pastSnapshot.getIndex(), pastSnapshot.getTargetDate());
     session.save(projectSnapshot);
   }
   session.commit();
 }