• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Which yields the best performance?

 
Jehan Jaleel
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

Thanks.
 
Christian Dillinger
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic