aspose file tools
The moose likes Object Relational Mapping and the fly likes Different between Criterial  and  Query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Different between Criterial  and  Query" Watch "Different between Criterial  and  Query" New topic

Different between Criterial and Query

Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
what is the Different between Criterial and Query?
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
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?
Consider Paul's rocket mass heater.
subject: Different between Criterial and Query