Springboot2 jpa關聯關係懶加載json序列化

【實體 報錯 】No serializer found for class org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer and no properties discovered to create BeanSerializer

 

Springboot2.x在使用jpa的getOne遇到的返回json報錯html

打印了User說明查詢正確可是返回json時報錯這個須要在對應實體上加下面註解java

@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"})

 

相關博客能夠參考https://www.cnblogs.com/sxdcgaq8080/p/6364736.htmljson

相關文章
相關標籤/搜索