File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Object Relational Mapping and the fly likes Which yields the best performance? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Which yields the best performance?" Watch "Which yields the best performance?" New topic

Which yields the best performance?

Jehan Jaleel
Ranch Hand

Joined: Apr 30, 2002
Posts: 196
Which of these are the best for performance in terms of data retrieval..

Criteria API
HQL in Java code
Native SQL in java code
Named query in hbm file

Christian Dillinger
Ranch Hand

Joined: Jul 20, 2009
Posts: 195
HQL, Criteria and NamedQueries are trandformed into PreparedStatements, so there cannot be any difference (for the same statement). Native SQL might be faster, because you can do some handmade "magic" Hibernate cannot do.
I agree. Here's the link:
subject: Which yields the best performance?
jQuery in Action, 3rd edition