Monday, February 28, 2005

Advantage of Direct SQL in ORM

Here is some discussion on comparison of Hibernate (generated SQL approach) and iBATIS (direct SQL approach). Cornerstone Persistence also uses direct SQL, which has been proven to be a great feature in developing production applications.
  • Performance: You can write the optimal SQL for your situation.
  • Debuggability: You can copy the SQL statement printed on debug console and run it in a database tool to see what's wrong. This is most useful when finding data related issues.
  • Simplificity: There is no extra (automatically generated) layer that you need to understand and maybe get around.
Cornerstone Persistence is very similar to iBATIS with the extra feature of customizability.