How to disable envers auditing for spring boot

[亡魂溺海] 提交于 2020-06-16 07:49:06

问题


i am creating a maven multimoduled project one of the module for the hibernate entity only , issue is two services/api/maven_project are using same module , but one requires auditing but other dont , how i can keep my code intact (means ,without changing or removing @Audited annotation) , how to enable or disable envers auditing at run time or compile time, because after everything i have tried auditing is working for both api

i have tried

spring.jpa.properties.hibernate.integration.envers.enabled=false
spring.jpa.properties.hibernate.listeners.envers.autoRegister=false
spring.jpa.properties.hibernate.envers.autoRegisterListeners=false

hibernate.integration.envers.enabled=false
hibernate.listeners.envers.autoRegister=false
hibernate.envers.autoRegisterListeners=false

回答1:


As per buræquete's answer

spring.jpa.properties.hibernate.integration.envers.enabled=false

Would do the job.

"Non-Spring Data JPA" Hibernate properties are configured through spring.jpa.properties.hibernate.*



来源:https://stackoverflow.com/questions/56848898/how-to-disable-envers-auditing-for-spring-boot

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