JPA解决问题经验v2021

1、com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class org.hibernate.proxy.pojo.bytebuddy.ByteBuddyInterceptor and no properties discovered to create BeanSerializer
原因:数据中存在null值导致无法正常序列化
解决:在实体类中添加@JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler"})

2、java.lang.IllegalStateException: No primary or single public constructor found for interface java.util.List - and no default constructor found either
原因:controller层无法自动接收List参数
解决:需要通过vo对象进行参数接收

你可能感兴趣的:(JPA解决问题经验v2021)