Jackson confused with bidirectional one-to-many relationship
I'm using jackson 1.9.2 with Hibernate/Spring MVC through MappingJacksonHttpMessageConverter. Jackson can not serialize bidirectional one-to-many relationship and makes an infinite loop. The classes I'm using are : Conversation which has a Set of SMS instances. Each SMS instance has a Set of PhoneNumbers Each PhoneNumber has a parent contact (this is the bidirectional many-to-one relationship) What I am trying to do is to serialize a conversation. If I don't use @JsonManagedReference and @JsonBackReference then jackson will crashe due to an infinite loop. But when I use them, the Contact doesn't get serialized into the PhoneNumber . Class Contact { @JsonManagedReference List<PhoneNumber> phoneNumber ; } Class PhoneNumber { @JsonBackReference Contact contact; } The output is : { <--------------------- Conversation "id": 51, "smsSet": [ { "id": 53, "origin...