Setting properties programmatically in Hibernate

前端 未结 5 896
别那么骄傲
别那么骄傲 2020-11-30 11:27

How can I ensure that all properties are loaded from hibernate.cfg.xml, then add additional properties programmatically? I saw the following code snippet but it looks like a

5条回答
  •  自闭症患者
    2020-11-30 11:35

    The code snippet you showed is what you need. Just use your existing configuration instead of creating a new one.

    If it is not you who instantiates the configuration (but, for example, spring), you'd need to extend the class that creates it.

提交回复
热议问题