Showing posts with label HQL. Show all posts
Showing posts with label HQL. Show all posts

Sunday, December 9, 2007

Is Hibernate Portable?

Hibernate is considered to be portable framework in which you can move from one databse to another database without the need to change the code at all, Does is it true?

It is true that most of the code and the HBM files (or anotations) would remain the same when moving from one database to another database, however there are some exceptional cases.

For example consider the following simple HQL query:
select from USERS where NAME=?

If the column NAME is nullable in the databse and you would pass null value as parameter then in MySQL it would return all the rows where NAME is NULL, However in Oracle it wouldn't return any row at all, the reason for it is that in Oracle
NULL==NULL is false.

There are other much more exceptional cases, please comment if you need other examples.

So the answer for the question is Hibernate Portable is Yes for 90% of code but No for 10% other perecent of code.

Links

 
RSS Feeds Submission Directory