return calcConfig;
}
protected RiskValueRequirement getRiskValueRequirement(final ValueProperties requirement) {
final String synthesizedForm = RiskValueRequirement.synthesize(requirement);
RiskValueRequirement riskValueRequirement = getHibernateTemplate().execute(new HibernateCallback<RiskValueRequirement>() {
@Override
public RiskValueRequirement doInHibernate(Session session) throws HibernateException, SQLException {
Query query = session.getNamedQuery("RiskValueRequirement.one.bySynthesizedForm");
query.setString("requirement", synthesizedForm);
return (RiskValueRequirement) query.uniqueResult();
}
});
if (riskValueRequirement == null) {
riskValueRequirement = new RiskValueRequirement(requirement);
getHibernateTemplate().save(riskValueRequirement);
getHibernateTemplate().flush();
}
return riskValueRequirement;
}