Why Hibernate Envers is ignoring my custom RevisionEntity?

╄→гoц情女王★ 提交于 2019-12-04 13:11:43

Finally i got where the problem was. My suspects were right, hibernate was ignoring my Envers classes because of this param in the EntityManagerFactory configuration:

<property name="packagesToScan" value="our.basepackage.otherpackage" />

We need to tell hibernate to check for 'our.basepackage'. Silly problem easy solution.

For any guy who is working with SpringBoot you may change this

@EntityScan(basePackages = {"yourpackage.entities","yourpackage.envers.entity"})

I got problems even after the above steps. I have added AuditedRevisionEntity to persistance.xml file to resolve the issue.

our.basepackage.otherpackage.AuditedRevisionEntity

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!