what is hibernate ceteria ?
Answers were Sorted based on User's Feedback
Answer / kameshwar
The interface org.hibernate.Criteria represents a query
against a particular persistent class. The Session is a
factory for Criteria instances.
Criteria crit = sess.createCriteria(Cat.class);
crit.setMaxResults(50);
List cats = crit.list();
| Is This Answer Correct ? | 5 Yes | 1 No |
Answer / 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 |
Answer / lal ajith kumara
Criteria technology used to search operations in hibernate.
| Is This Answer Correct ? | 0 Yes | 0 No |
Should we create system software ( e.g operating system ) in java ?
What are maps interfaces in the java collections? : java collections
how to deploy the web application ?
Write a postfix expression to (a*(b+c/d)*d-e)
when exactly should we use throws ,and wen exactly should we use the try and catch for exceptional handling
In hyderabad, which s/w training center is best for java, other than corejava what r the new tools to learn in java,which tool is best & have current requirement,pls give me information about java to learn ?
what is the IDE that you have used to write your java programs?
2 Answers Inforica, Interface Software,
what is diff string and stringbuffer
what is the difference between checked and unchecked Exceptions?
What are the main classes of the list interfaces? : java collections
Hi Friends, i have searched in google but not clear. can you give bank example with synchronized keyword
what debugging tool that can be used to debug the java programs?