0

I'm successfully logging entities with Javers, but for every entity I have to put @DiffIgnore and @ShallowReference to ignore fields mapped with @OneToMany, @ManyToOne, etc. I'm trying to configure on JaversBuilder, but without success. Is there a way to configure on Javers to automatically ignore properties mapped with these annotation? Or only take properties with @Column annotation?

I read these, and tried to follow some of the answers, but it didn't worked either.

Javers - DiffIgnore on bidirectional OneToMany

Javers default ignore instead of default include

JJJ
  • 32,902
  • 20
  • 89
  • 102
Javarian
  • 127
  • 2
  • 13

1 Answers1

0

There is no way to order JaVers to ignore a field when it has a specific annotation. JaVers doesn't read all annotations in your classes.

You can implement a annotation scanner on your side and then register your EntityDefinitions in JaversBuilder:

public JaversBuilder registerEntity(EntityDefinition entityDefinition)

Bartek Walacik
  • 3,386
  • 1
  • 9
  • 14
  • Thanks, but from what I see, I'll have to do it for every entity, and I'm already doing it, using the DiffIgnore and ShallowReference annotations. The advantage is that i can do some code to do it automatically using this entity definition. But anyway, thanks for the answer. – Javarian Dec 12 '18 at 10:36