”严重: Exception occurred during processing request: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: infosys.User.info, could not initialize proxy - no Session net.sf.json.JSONException: “
网络上很多说是懒加载的错误等等,我都试了,但不对。
这里对要查询的类做了一对多,多对一映射,做查询后得到的List集合中包含映射的“对象类”,
此时要转换的List集合中的对象及有属性,又有对象,在此之前把List集合中的对象属性中只留下需要的属性存入List 再回去转换即可。