My objective is to avoid the creation of the same object twice. I want to deserialize an array of two objects that contain the same child object, this is the JSON object that I want to deserialize
[
{
@id: 98,
relatedPackage: {@id:99, receivedOn:1374012807237, packingTypeFk:1,…}
},
{
@id: 101,
relatedPackage: {@id:99, receivedOn:1374012807237, packingTypeFk:1,…}
}
]
and this is the POJO
@JsonIdentityInfo(generator=ObjectIdGenerators.IntSequenceGenerator.class, property="@id")
public class Package extends StampedModel {
...
}
In the last code you can see that I put the annotation @JsonIdentityInfo to achieve my objective but it doesn't do the job. Always that I send this array to the server, it creates two diferent packages.
What am I doing Wrongo?