Cyclic references in a bidirectional many to many relationship

后端 未结 2 1540
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-12 00:53

I\'m having a bidirectional many to many relationship in my entities. See the example below:

public class Collaboration {

    @JsonManagedReference(\"COLLAB         


        
2条回答
  •  暖寄归人
    2021-01-12 01:46

    very handy interface implementation is provided in jackson 2 library as

    @Entity
    @JsonIdentityInfo(generator=ObjectIdGenerators.PropertyGenerator.class, property="id")
    public class Collaboration { ....
    

    in maven

    
        com.fasterxml.jackson.core
        jackson-core
        2.0.2
    
    

提交回复
热议问题