简体   繁体   中英

spring jpa onetomany join table auditing

I have a oneToMany and ManyToOne mapping in my models:

class college

@OneToMany(fetch = FetchType.EAGER)
@JoinTable(name = "collegecource", joinColumns = @JoinColumn(name = "college", referencedColumnName = "college"), inverseJoinColumns = @JoinColumn(name = "cource", referencedColumnName = "cource"))
private Set<course> course;

In a relation able table collegecource i have one extra column isActive

I want to audit all the tables with create/update/delete.

I added @Audited in collegecource

@Audited
public class collegecource 

When i try to create/update parent with relational data Audit working fine. But when i try to delete relational data (Child data) it is not auditing.

Can You please help me.

If you want audit field, Annotation your field with @Audited.

(Child data)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM