Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
3.2.1
Name and version of the database you are using:
Oracle 10g, MySQL 5.1
Problem Description:
We use oracle’s connect by queries to get all the children of a given node. Now we are trying to make our application database independent by trying to push all the database specific code (connect by, analytical function etc.) to stored procedures and make them return result sets.
Hibernate’s documentation says to use the below syntax in the hibernate-mapping file to call a stored procedure using named query.
Code:
{?=call GET_ALL_CHILDREN(?,?)}
But the syntax is only true for Oracle database in my case. I tried using the same syntax for MySQL database and it throws exceptions. When I change the syntax to
Code:
{call GET_ALL_CHILDREN(?,?)}
everyting works fine in MySQL.
My questions are:
1) Is there a way I can make my application database independent?
2) Is there a different approach I need to take to attain database independence?
I might ask some more question as I remember.
Thanks
Code: