fastjson&gson

1.model转fastjson时,model成员变量是对象的,再转成fastjson时,不能仅仅判断key是否存在。应该判断其值是否为""。

2.gson 在 dao层貌似没有用武之地。

作为parameterType时,会报org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'user_name' in 'class com.google.gson.JsonObject'

作为resultType时,没有异常但是获取的对象为null

3.fastjson放gson对象时,toJSONString()  || toString()会报异常Exception in thread "main" java.lang.UnsupportedOperationException: JsonObject

get没有问题

原文地址:https://www.cnblogs.com/daixiaotian/p/8391110.html