• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • Al Hobbs
  • salvin francis

Hibernate Native SQL versus iBATIS

Ranch Hand
Posts: 281
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have used Hiberbernate in production in the past. I have used HQL of Hibernate, never used Native SQL though.

However for the new project, I have a complex database over which I do not have much control.

If I were to choose Hibernate (version 3.2) for this new project, I will have a frequent need to use Native SQL.

So, this is my question:
1. If I were to use Hibernate 3.2 with Native SQL in several places of the project, am I better off using iBATIS?

If it is not possible to answer my above question (question 1), without additional details, will it be possible to provide me some pointers and links on the following questions:
2. What are the drawbacks of using Native SQL in Hibernate?
3. What was the motivation of introducing Native SQL with the newer version of Hibernate?
4. What are the advantages of using Nattive SQL?
Posts: 17346
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First I would just point out that even if you have no control over how the database is modeled, doesn't stop you from mapping Java Objects to those database tables. Hibernate can pretty much map to any database model.

As far as using straight SQL, I would choose iBatis over JDBC, and if everything you write will be native SQL queries then I can also recommend iBatis. But if it was me personally, I still would choose Hibernate.

You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic