Home  >  Forum  >  Hibernate
Post New Query

Use of criteria in hibernate


joined on
September 17,2013
Asked on September 17,2013
I don't know what does this line mean. Can you please explain me its meaning?
List<Car> list=session.createCriteria(Car.class).add(Restrictions.naturalId().set("vehicleRegNum","UP65 BN 2343")).list();

I refer to your tutorials and this query is in the below given page:
http://www.concretepage.com/hibernate/naturalid_hibernate_annotation.php
joined on
March 14,2013
Replied on September 17,2013

Here Car is an entity representing car table and session.createCriteria will create the query like

select * from car where vehicleRegNum='UP65 BN 2343'

list will contain the result of this query
joined on
October 10,2013
Replied on October 10,2013

Good Explanation

Write Answer








Copyright ©2017 concretepage.com, all rights reserved |Privacy Policy | Contact Us