Use of criteria in hibernate

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:

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

Replied on October 10, 2013
Good Explanation

Write Answer

©2024 | Privacy Policy | Contact Us