2

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 3

3

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.

Sign up to request clarification or add additional context in comments.

Comments

3

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

+1 for "I really don't think you want to mess with the Hibernate Core"... I really don't want to! :P
1

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:

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.