首页 > 其他 > 详细

JPA 懒加载带来的问题

时间:2021-09-02 21:19:53      阅读:18      评论:0      收藏:0      [点我收藏+]

原理暂不清楚,先记录待解决。

com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class org.hibernate.proxy.pojo.bytebuddy.ByteBuddyInterceptor and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: top.harmonytqs.entity.Demo$HibernateProxy$wprVXf6u["hibernateLazyInitializer"])

解决方法:在实体类上加上如下注解

//忽略序列化:在 json 序列化时忽略bean中的一些不需要转化的属性
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})

JPA 懒加载带来的问题

原文:https://www.cnblogs.com/200ok/p/15219898.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!