Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Different between Criterial and Query

 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the Different between Criterial and Query?
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you talking about Hibernate? Assuming yes.

Criteria API is a facility given by Hibernate to the folks, who are not comfortable with SQL or doesn't like to write that ;). It has a several methods to prepare an SQL statement. Although, its very powerful and rich, but sometimes you have to go with SQL/HQL way when things are more sophisticated and deem out of reach of Criteria API.

Now Query, here its very ambiguous. Are you talking about HQL, or javax.persistence.Query?
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!