-
-
Notifications
You must be signed in to change notification settings - Fork 382
Description
Recently i got this error,
can not handle managed/back reference 'defaultreference' in jackson for composite key
I googled alot but found the below option to use,
JsonManagedReference and JsonBackReference
Reference-> http://wiki.fasterxml.com/JacksonFeatureBiDirReferences
But my situation is,
Class Parent{
private int id;
@JsonManagedReference
Set childSet;
}
Class Child{
private ChildId childId;
private String name;
}
Class ChildId{
private int childKey;
@JsonBackReference
private Parent parent;
}
As you see, in the child class it has a composite key. I can not change this since it has relationship with DB.
Can anybody help me with this issue?
Note:
I'm using Jackson 2.4.3
I'm using Javers 1.2.9 for Object comparison
Update:
I removed all the JsonManaged and JsonBackReference annotations and added only JsonIgonre in Child as below,
Class ChildId{
private int childKey;
@JsonIgnore
private Parent parent;
}
After doing this I got the below error,
11:39:59,712 ERROR SetChangeAppender:46 - could not diff Field Set Child1; //declared in: Parent, JaVers runtime error - diff for Set of ValueObjects is not supported