Infinite Recursion with Jackson JSON and Hibernate JPA issue

前端 未结 25 3744
你的背包
你的背包 2020-11-21 07:31

When trying to convert a JPA object that has a bi-directional association into JSON, I keep getting

org.codehaus.jackson.map.JsonMappingException: Infinite          


        
25条回答
  •  傲寒
    傲寒 (楼主)
    2020-11-21 07:39

    you can use DTO pattern create class TraineeDTO without any anotation hiberbnate and you can use jackson mapper to convert Trainee to TraineeDTO and bingo the error message disapeare :)

提交回复
热议问题