hibernate 4 - sessionFactory.addPackage - 配置文件模拟?

时间:2015-01-22 19:26:39

标签: java hibernate orm configuration hibernate-4.x

我认为在Hibernate 3中有一个属性键hibernate.packagesToScan
哪一个可以在hibernate.cfg.xml的会话工厂级别设置 在Hibernate 4中是否更改了此键,如果是,它的相应键是什么?

我正在使用4.3.8版最终版。

1 个答案:

答案 0 :(得分:1)

在hibernate属性中,您需要:

<property name="hibernate.archive.autodetection" value="class, hbm" />

在persistence.xml中,您需要:

<exclude-unlisted-classes>false</exclude-unlisted-classes>
相关问题