My current workstation uses the standard Spring / Hibernate / JSP mix to serve content to the Flex client through XML. There are many ways to access data, but the most common is to call SQL directly into a database and manually convert to XML.
The problem is that as the application gets larger, SQL has become much more complex and more difficult to maintain. As if it werenβt difficult enough to support SQL queries created with StringBuilders, itβs even worse now that SQL arrays are built dynamically using many if statements and loops.
I know that usually the right way is to fetch elements using Hibernate queries and entities. However, in some of our queries, the results cannot be mapped to a single Hibernate object, and I'm afraid that direct SQL should be used.
What will be the right way? Is there a way to make dynamic SQL queries more readable? Is there a way to do this with Hibernate objects?
I apologize for the abstract nature of this issue. I hope you have a good contribution nonetheless;)
Appreciate your comments!
java sql orm hibernate
Nadav
source share