Mybatis懒加载导致Json序列化问题
问题现场:
使用Mybatis, <collection> 标签, 查一个实体类,和其子List. 报错
[simple type, class org.apache.ibatis.executor.loader.javassist.JavassistProxyFactory$EnhancedResultObjectProxyImpl]; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class
org.apache.ibatis.executor.loader.javassist.JavassistProxyFactory$EnhancedResultObjectProxyImpl and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: com.shuidihuzhu.cs.client.dto.ResponseDto["data"]->com.shuidihuzhu.cs.client.dto.Pag