String s ="{\"SITECLASS\":213}"; TbOperatelog tbOperatelog =new TbOperatelog();Map map = JSONObject.parseObject(s);Record record =new Record();record.setColumns(map); tbOperatelog.put(record); System.out.println(tbOperatelog.getSiteclass());
TbOperatelog 中SITECLASS字段是BigDecimal类型,如果这样转的话会报 java.lang.Integer cannot be cast to java.math.BigDecimal
TbOperatelog 是自动生成的,oracle中int会自动转为BigDecimal。
各位大神有解决办法吗
项目:JFinal
TbOperatelog tbOperatelog
= JSONObject.parseObject(s, TbOperatelog.class);