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
Should we create system software ( e.g operating system ) in java ?
please mail me the interview question based on java/j2ee
What is deque in the java collections framework? : java collections
who will give req's to u?. how they send req's to u? . what design documents contains?. when bugs raised on other developer code how to report to them?.(throgh mail or ........). how to retrive 100 recods from dao layer to presentation layer.using which collection?. what is sequence diagram.?.
What do you understand by synchronization? Why is it important?
What is the Spring2.5 MVC Navigation flow?
What are the types of java collections? : java collections
What are the uses of the set interfaces in the java collections? : 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 types of interface used in the java collections? : java collections
What are the types of the main implementing classes in the map interfaces? : java collections
What are the classes in the java collection framework? : java collections
What are the considerations to be made in case of loops in java ?
What is the difference between comparable and comparator in java.util pkg?
What is the use of hashcode in java ?