how to Fix spring boot one to many bidirectional infinity loop?

后端 未结 3 1356
被撕碎了的回忆
被撕碎了的回忆 2021-01-20 00:45

i am try to create a one to many bidirectional mapping using spring boot and spring data jpa please look the below entity

Employer Entity

3条回答
  •  太阳男子
    2021-01-20 01:01

    with the JSON its a problem with bi-directional mapping. Use the below properties.

    @JsonIgnoreProperties("employer")
    @JsonIgnoreProperties("employees")
    

    please keep fetching type as eager.

    hope this will work.

提交回复
热议问题