【问题标题】:How to store Hibernate Envers audit tables into a different schema?如何将 Hibernate Envers 审计表存储到不同的模式中?
【发布时间】:2017-01-13 06:47:03
【问题描述】:

如何配置 Hibernate Envers 以将审计表存储到不同的架构中?

【问题讨论】:

    标签: jpa hibernate-envers hibernate


    【解决方案1】:

    根据hibernate user guide - envers configuration documentation,这应该可以通过设置配置实现

    org.hibernate.envers.default_schema
    

    默认为

    null(与被审计表相同的架构)

    应该用于审计表的默认模式名称。可 使用 @AuditTable( schema="...​" ) 注解覆盖。如果不 目前,架构将与正在被调用的表的架构相同 已审核。

    【讨论】:

      【解决方案2】:

      使用 JPA 时,配置键必须以 spring.jpa.properties 为前缀:

      spring.jpa.properties.org.hibernate.envers.default_schema=customaudit
      

      【讨论】:

        猜你喜欢
        • 2014-09-19
        • 2015-08-20
        • 2023-03-24
        • 1970-01-01
        • 2018-09-19
        • 1970-01-01
        • 2015-12-14
        • 2019-01-22
        • 2016-03-19
        相关资源
        最近更新 更多