老师,遇到了一个懒加载的问题。
com.github.dozermapper.core.config.resolvers.LegacyPropertiesSettingsResolver. Hibernate: select spu0_.id as id1_3_, spu0_.create_time as create_t2_3_, spu0_.delete_time as delete_t3_3_, spu0_.update_time as update_t4_3_, spu0_.category_id as category5_3_, spu0_.default_sku_id as default_6_3_, spu0_.description as descript7_3_, spu0_.discount_price as discount8_3_, spu0_.for_theme_img as for_them9_3_, spu0_.img as img10_3_, spu0_.is_test as is_test11_3_, spu0_.online as online12_3_, spu0_.price as price13_3_, spu0_.root_category_id as root_ca14_3_, spu0_.sketch_spec_id as sketch_15_3_, spu0_.subtitle as subtitl16_3_, spu0_.tags as tags17_3_, spu0_.title as title18_3_ from spu spu0_ Hibernate: select spu0_.id as id1_3_, spu0_.create_time as create_t2_3_, spu0_.delete_time as delete_t3_3_, spu0_.update_time as update_t4_3_, spu0_.category_id as category5_3_, spu0_.default_sku_id as default_6_3_, spu0_.description as descript7_3_, spu0_.discount_price as discount8_3_, spu0_.for_theme_img as for_them9_3_, spu0_.img as img10_3_, spu0_.is_test as is_test11_3_, spu0_.online as online12_3_, spu0_.price as price13_3_, spu0_.root_category_id as root_ca14_3_, spu0_.sketch_spec_id as sketch_15_3_, spu0_.subtitle as subtitl16_3_, spu0_.tags as tags17_3_, spu0_.title as title18_3_ from spu spu0_ where spu0_.id=? Hibernate: select spu0_.id as id1_3_, spu0_.create_time as create_t2_3_, spu0_.delete_time as delete_t3_3_, spu0_.update_time as update_t4_3_, spu0_.category_id as category5_3_, spu0_.default_sku_id as default_6_3_, spu0_.description as descript7_3_, spu0_.discount_price as discount8_3_, spu0_.for_theme_img as for_them9_3_, spu0_.img as img10_3_, spu0_.is_test as is_test11_3_, spu0_.online as online12_3_, spu0_.price as price13_3_, spu0_.root_category_id as root_ca14_3_, spu0_.sketch_spec_id as sketch_15_3_, spu0_.subtitle as subtitl16_3_, spu0_.tags as tags17_3_, spu0_.title as title18_3_ from spu spu0_ where spu0_.id=? org.springframework.http.converter.HttpMessageConversionException: JSON mapping problem: com.example.missyou.model.Spu["skuList"]; nested exception is com.fasterxml.jackson.databind.JsonMappingException: failed to lazily initialize a collection of role: com.example.missyou.model.Spu.skuList, could not initialize proxy - no Session (through reference chain: com.example.missyou.model.Spu["skuList"])
老师,在请求/v1/spu/id/2/detail接口的时候遇到以上懒加载的问题,我百度了一下可以把懒加载改成fetch = FetchType.EAGER,但是又遇到了启动的时候加载项过多的问题.
25
收起
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星