Package org.springframework.orm.hibernate3

Examples of org.springframework.orm.hibernate3.HibernateTemplate.findByCriteria()


  private Number query(String value) {
    HibernateTemplate template = new HibernateTemplate(sessionFactory);
    DetachedCriteria criteria = forClass(entity).add(eq(field, value))
        .setProjection(count(field));
    return (Number) template.findByCriteria(criteria).iterator().next();
  }

}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.