JPQL:It is base on HQL.
HQL
Hibernate Criteria API alternative to HQL
Criteria cr = session.createCriteria(Person.class);
cr.add(Restrictions.eq("lastname", "test"));
@SuppressWarnings("unchecked")
List <Person>hibernateCriteriList = cr.list();
if (hibernateCriteriList != null) {
for(Person personList : hibernateCriteriList) {
System.out.println(" -Using Hibernate Criteria API Age: "
+ personList.getAge());
}
}
No comments:
Post a Comment