getting hibernate default schema name programmatically from session factory?

后端 未结 4 1000
无人及你
无人及你 2021-02-07 15:24

I was wondering if there is a way to get the default schema name from session factory, somehow? The reason I need to get it is because I have to use a one native SQL and I have

4条回答
  •  南旧
    南旧 (楼主)
    2021-02-07 15:53

    @Ryan Morlok, I can not comment on your answer due to lack of reputation. Your answer is correct, but its deprecated now. In hibernate version 5.0.1, schema name can be get using

    (SessionFactoryImpl)sessionFactory).getProperties().getProperty("hibernate.default_schema")
    

提交回复
热议问题