休眠envers不会为jpa查询触发 [英] hibernate envers does not get triggered for jpa queries
问题描述
我正在使用hibernate envers来审核事件,当我调用repositoy.delete()或repository.save()时,它可以与Spring Data JPA Repository一起很好地工作
I am using hibernate envers to audit events and it works fine along with Spring Data JPA Repository when i invoke repositoy.delete() or repository.save()
但是,如果我编写了一个jpa查询并使用查询删除了该实体,则它会休眠而不会调用审计侦听器.
But If I write a jpa query and delete the entity using a query , then it hibernate envers audit listener does not get invoked.
我读到hibernate envers不会捕获本机查询-但是它也不适用于hibernate/jpa查询吗?
I read that hibernate envers will not trap native query - But will it not work for hibernate/jpa queries as well ?
谢谢 生活
推荐答案
如此发布,您的情况不会触发envers.
As mentioned in this and this post, envers is not triggered in your situation.
还可以在JBoss论坛中查看与此相关的问题
Also check out this related question in the JBoss forum
这篇关于休眠envers不会为jpa查询触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!