Can anyone please tell me the difference between Hibernate’s:
createCriteriacreateQuerycreateSQLQuery
Can anyone tell me what data these three functions return, c.q. direct me to a proper and simple link to study these Hibernate functions?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To create query in the Hibernate ORM framework, there is three different types. The following are the three ways to create query instance:
session.createQuery()session.createSQLQuery()session.createCriteria()Look into the details of each category in detail.
The method createQuery() creates Query object using the HQL syntax. For example:
The method createSQLQuery() creates Query object using the native SQL syntax. For example:
The method createCriteria() creates Criteria object for setting the query parameters. This is more useful feature for those who don’t want to write the query in hand. You can specify any type of complicated syntax using the Criteria API.