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