• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Programatically Determining Dialect

 
Jason Ferguson
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to determine the Hibernate Dialect in for my currently configured SessionFactory within my code.

The reason is that if I am using Oracle, I want to use a custom query (using the CONNECT BY PRIOR keywords), but otherwise just use a normal criteria query.

How can I determine the dialect name?

(Yes, I know, proprietary bad... hiss... evil... but I have a report with HORRIBLE performance and very low odds of changing databases, but have to make my boss happy).
 
Jason Ferguson
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Disregard. I just have to cast my SessionFactory to SessionFactoryImpl and call getDialect().
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic