}
public ProductPoint get(final Product p, final int years, final int type) {
HibernateTemplate t = new HibernateTemplate(getSessionFactory());
return (ProductPoint)t.execute(
new HibernateCallback() {
public Object doInHibernate(Session s) throws HibernateException, SQLException {
return s.createCriteria(getHandledClass())
.add(Restrictions.eq("product", p))
.add(Restrictions.eq("years", new Integer(years)))