一个案例 POJO没有set方法, 造成反序列化时出现NPE问题.实际场景:POJO是第三方提供的,final public class XJSONTest { public static void main(String[] args) { String inStr = "{\"isSuccess\":true}"; // Google Gson Gson gson = new Gson(); Result result = gson.fromJson(inStr
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
Jackson import lombok.Data; @Data public class Student { private Long id; private String name; private Integer age; private String sex; private String[] interest; } public class Test { public static void main(String[] args) throws IOException { Stude