怎么从代码中获取hibernate中配置的数据库方言信息

如何从代码中获取hibernate中配置的数据库方言信息使用方法如下:SessionFactoryImpl sessionFactory (Se

如何从代码中获取hibernate中配置的数据库方言信息

使用方法如下:

SessionFactoryImpl sessionFactory = (SessionFactoryImpl)Application.getBeanContext().getBean(SessionFactory.class);System.out.println(sessionFactory.getDialect());
?

Application为工具类,实际上就是从spring bean上下文中获取sessionFactory bean,然后从该bean中获取相关的本地方言配置信息。

?