This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
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

Win a copy of Head First Android this week in the Android forum!
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: 189
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?
It's not a secret anymore!