I am using hibernate with Oracle database and there is one configuration for dialect, I understood that dialect is used to generate native sql. But I checked the output of generated queries on screen with dialect and without dialect, both seems to same, then what is the use of dialect? can somebody give an code example where in we can rectify this?
Asked
Active
Viewed 589 times
0
-
This helps ? http://stackoverflow.com/questions/21012799/why-do-i-need-to-configure-the-sql-dialect-of-a-data-source – Suresh Atta Sep 11 '15 at 07:10
1 Answers
2
What version of hibernate are you using ? Since version 3.2, hibernate is able to determine dialect automatically. If it detect the right one, you won't see any difference between specifying it or not.
Reference : http://docs.jboss.org/hibernate/orm/5.0/userGuide/en-US/html_single/#portability-dialectresolver

Thierry
- 5,270
- 33
- 39
-
your right! This could be the reason, that I am not getting to see any difference. You figured it out correctly. Thanks. – eatSleepCode Sep 11 '15 at 07:30
-
You're welcome. In any new app i develop, i let hibernate auto detect the dialect. Never seen a detection issue (at least when used with h2 / postgres or oracle). It is one less thing to think of when configuring profiles ;) – Thierry Sep 11 '15 at 07:43
-
The only problem are new database versions for databases that have version specific dialects, for example MS SQL and Oracle. In these cases you need to set the correct dialect explicitly, as the default resolver fails here. – Tobias Liefke Sep 11 '15 at 12:35