I'm using Hibernate Envers in order to audit my entities. But I have a problem. I want to audit an Entity that have a ManyToMany relationship. I found that exists an @AuditJoinTable but I don't have idea how it works. Can someone giveme an example?
相关问题
- JPA one-to-many association to an entity with @Inh
- How does the JPA handle partial, non-disjoint inhe
- How does the JPA handle partial, non-disjoint inhe
- Tell hibernate hbm2ddl not create individual table
- How can I access the repository from the entity in
相关文章
- 这个SpringBoot 2.2.x,怎么判断?
- Hibernate Tutorial - Where to put Mapping File?
- Hibernate doesn't generate cascade
- Setup and Tear Down of Complex Database State With
- Writing CRUDRepository's findBy() method on a
- QueryDSL Window functions
- How to left join unrelated entities?
- JPA configure boolean fields to persist as integer
Auditing many-to-many relations should work without any additional configuration, provided that both sides of the relation are audited.
As to
@AuditJoinTable
, the annotation is used to specify a custom table name of the join table. See:http://docs.jboss.org/hibernate/orm/4.1/javadocs/org/hibernate/envers/AuditJoinTable.html
The default name is
[Referencing entity name]_[Referenced entity name]_AUD
. The annotation doesn't have to be used, if the default table name is fine.