public void importProfile(RulesDao rulesDao, RulesProfile toImport) { if (toImport.getEnabled() == null) { // backward-compatibility with versions < 2.6. The field "enabled" did not exist. Default // value is true. toImport.setEnabled(true); } importActiveRules(rulesDao, toImport); importAlerts(toImport); session.save(toImport); }
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(); }