I'm a little curious, is there a way to modify the hibernate's core so i can customize the generated SQL query. For example, to add functionality in the generated query to use connect by prior (oracle) or any other clause that I want to customize.
3 Answers
At first, such questions always ring some warning bells in me. You have been warned...
AFAIK, hibernate uses so called dialects for specific optimizations. Maybe you could extend one of the existing Oracle dialects or supply your own.
Comments
You can create your custom dialect by subclassing the Oracle dialect. That should be the easier approach, in my opinion. I really don't think you want to mess with the Hibernate Core.
1 Comment
DBMS-specific features such as CONNECT BY are usually used in Hibernate applications by issuing native SQL queries. Their results can be mapped to entities so that you can use them almost the same way as regular HQL queries.
Attempts to make Hibernate generate them would be an overkill.
See also: