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 different types of collections views being provided by the map interface? : java collections
can u draw class/object diagram for ATM
Hi we have an urgent requirement for Java/J2ee technical lead position & also looking for "Java Guidewire claimcentre" experienced professional for Bangalore location if interested can reach srisanh@gmail.com
What are the queues in the java collection framework? : java collections
Which server-side script takes the input from JavaScript, can access the database if it needs to, and processes the data.
What are the uses of the set interfaces in the java collections? : java collections
What are the differences between the java collection and the java list? : java collections
What are the different types of classes implemented in the set interfaces? : 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.?.
Which sorting algorithm is used by collections.sort() in java ?
What are the considerations to be made in case of loops in java ?
What do you understand by synchronization? Why is it important?
What is an algorithm in java collection framework? : java collections
Hi Friends, i have searched in google but not clear. can you give bank example with synchronized keyword