what is hibernate ceteria ?

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


Please Help Members By Posting Answers For Below Questions

What are the interfaces in java collections? : java collections

618


What are the queues in the java collection framework? : java collections

553


What are the differences between the java collection and the java list? : java collections

617


Which server-side script takes the input from JavaScript, can access the database if it needs to, and processes the data.

1602


What is the difference between comparable and comparator in java.util pkg?

594






What is the Spring2.5 MVC Navigation flow?

5375


what is mean by hasing and maping in java platform and advantage?

1833


What are the different types of features of the java collections framework? : java collections

576


What is deque in the java collections framework? : java collections

542


Which java collection class can be used to maintain the entries in the order in which they were last accessed?

562


What are the main classes of the list interfaces? : java collections

579


What are the different types of classes implemented in the set interfaces? : java collections

610


What is an algorithm in java collection framework? : java collections

583


What is the enumerator of the java collection framework? : java collections

567


What are the types of interface used in the java collections? : java collections

591