P E N C I L
Login
Hibernate annotations + query
  1. @Transactional("myTransactionManager)
    class MyClass {}
  2. Query
    DetachedCriteria criteria = DetachedCriteria.forClass(MobileAuthenticationFront.class);
    criteria.add(Restrictions.eq(MobileAuthenticationFront.USERNAME, client));
    List list = getHibernateTemplate().findByCriteria(criteria);
  3. Query with HQL
    List<MyClass> getHibernateTemplate().find("select a from MyClass a, MyClass b where a.a=b.b and a.c=?", value);