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 |
What is the servletcontext listener and what is JspContext and page context pls tell in simple words.
Hi frnds how to lock an user when he enter wrong credentials more than 3 time using java or j2ee tech take username and password in a bean no need to connect DB and validate give me some sample application code or links its urgent for me thanks in advance
What is markup language?
what is the difference between banking and insurance domain?
Difference b/w >> and >>> ?
what about web architecture?
whats the relation ship between LDAP and JNDI?
What is the enumerator of the java collection framework? : java collections
What is the use of hashcode in java ?
what is the difference between through and throws?
i need java 1+ experience resume on java developer kindly send me my mail id:srikanthreddy1.marla@gmail.com
Which server-side script takes the input from JavaScript, can access the database if it needs to, and processes the data.