出现了两种情况:
- 日期格式
- hibernate延时加载
1.在hibernate配置文件中用到了:
<property name="shenqingriqi" type="date"></property>
可能问题一:
JSON对象把date认为是java.sql.Date
解决方案:
把hibernate配置文件改为:
<property name="shenqingriqi" type="java.util.Date"></property>
这样应该就可以了。
2.
解决:hibernate延时加载 设置
- JsonConfig cfg = new JsonConfig();
- cfg.setExcludes(new String[]{"handler","hibernateLazyInitializer"});