Sunday, June 22, 2014

Hibernate hql

Query qry = session.createQuery("from Person p where p.age>20");

@SuppressWarnings("unchecked")
List <Person>hqlList = qry.list();
if (hqlList != null) {
for (Person personList : hqlList)
System.out.println(" -Using Hibernat hql Age: "
+ personList.getAge());
}

No comments:

Post a Comment