Does Hibernare Envers support model classes that use mappings?

依然范特西╮ 提交于 2019-12-12 01:53:11

问题


So far I've not seen any examples where the classes are using hibernate mapping. They all seem to use annotations. Would it work if I use mappings to wire the classes?


回答1:


It's not possible. The unique way to work with Envers is by annotations.

Look: https://hibernate.atlassian.net/browse/HHH-3887




回答2:


I wasn't sure if you mean't configure Envers auditing within the hbm files or just add Envers within the application.

  • If you need to configure within hbm, no is not possible as Rafael Zeffa previous answered. See this issue for reference
  • If you need to use Evers within a existing Application that has it's entities mapped with hbm.xml files, It's possible, you just need to add the Envers annotations as needed. I've created a sample application demonstrating this. You can download it here


来源:https://stackoverflow.com/questions/27572785/does-hibernare-envers-support-model-classes-that-use-mappings

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