How to avoid cyclic redundancy using Jackson library for Many-to-Many entities?

Use the following code, to avoid cyclic redundancy using jackson library for converting Many-to-Many java entities to JSON.

@JsonIdentityInfo(generator = ObjectIdGenerators.IntSequenceGenerator.class,
                  property = "@id")
public class Student{}

To avoid creating '@id',for every object in JSON, ObjectIdGenerators can be set to None as follows.

@JsonIdentityInfo(generator = ObjectIdGenerators.None,
                  property = "@id")
public class Student{}
Technology: 

Search