遇到问题:
Could not write JSON: Unable to find com.demo.girl.Girl with id 18;
nested exception is com.fasterxml.jackson.databind.JsonMappingException:
Unable to find com.demo.girl.Girl with id 18 (through reference chain: com.demo.girl.Girl_$$_jvst9b8_0[\"age\"]
解决办法:在Girl实体类上加JsonIgnoreProperties注解把不需要序列化的属性屏蔽掉
@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler" })