Answer Posted / sushant
Hibernate is a replacement of DAO layer used in traditional
JDBC based applications.
And similarly you can say that Criteria is a replacement for
query to the DB.
Used somewhat like...
Session session = sessionFactory.openSession();
Criteria demoCriteria = session.createCriteria(Animal.class);
....
later you can set some property or restrictions in the query...
demoCriteria.add( Restrictions.like("name", "Dog%") )..
...etc.
..
and then execute this criteria to get the results.
List resultsList = demoCriteria.list();
hope that helps.
Mail me for some more info if you require some.
-Sushant
Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What are the interfaces in java collections? : java collections
What are the queues in the java collection framework? : java collections
What are the differences between the java collection and the java list? : java collections
Which server-side script takes the input from JavaScript, can access the database if it needs to, and processes the data.
What is the difference between comparable and comparator in java.util pkg?
What is the Spring2.5 MVC Navigation flow?
what is mean by hasing and maping in java platform and advantage?
What are the different types of features of the java collections framework? : java collections
What is deque in the java collections framework? : java collections
Which java collection class can be used to maintain the entries in the order in which they were last accessed?
What are the main classes of the list interfaces? : java collections
What are the different types of classes implemented in the set interfaces? : java collections
What is an algorithm in java collection framework? : java collections
What is the enumerator of the java collection framework? : java collections
What are the types of interface used in the java collections? : java collections