}
return hbComputationTargetSpecification;
}
protected CalculationConfiguration getCalculationConfiguration(final String name) {
CalculationConfiguration calcConfig = getHibernateTemplate().execute(new HibernateCallback<CalculationConfiguration>() {
@Override
public CalculationConfiguration doInHibernate(Session session) throws HibernateException, SQLException {
Query query = session.getNamedQuery("CalculationConfiguration.one.byName");
query.setString("name", name);
return (CalculationConfiguration) query.uniqueResult();
}
});
if (calcConfig == null) {
calcConfig = new CalculationConfiguration();
calcConfig.setName(name);
getHibernateTemplate().save(calcConfig);
getHibernateTemplate().flush();
}
return calcConfig;
}