2017-12-13 23:49

@JFinal 我这还是不能转,转换出的结果是:{} 测试样例:String pojson = FastJson.getJson().toJson(dicBusiness);//dicBusiness对象转换为json串:{"id":30,"name":"男","pid":0,"type":"XB"}
DicBusiness dic = FastJson.getJson().parse(pojson, DicBusiness.class);//再把json串({"id":30,"name":"男","pid":0,"type":"XB"})转换为DicBusiness对象,对象debug为{};

样例的model对象:
public class DicBusiness extends BaseDicBusiness {
public static final DicBusiness dao = new DicBusiness().dao();
}
以及对象继承的BaseDicBusiness代码:
public abstract class BaseDicBusiness> extends Model implements IBean {

public M setId(java.lang.Long id) {
set("id", id);
return (M)this;
}

public java.lang.Long getId() {
return getLong("id");
}

public M setPid(java.lang.Long pid) {
set("pid", pid);
return (M)this;
}

public java.lang.Long getPid() {
return getLong("pid");
}

public M setType(java.lang.String type) {
set("type", type);
return (M)this;
}

public java.lang.String getType() {
return getStr("type");
}

public M setName(java.lang.String name) {
set("name", name);
return (M)this;
}

public java.lang.String getName() {
return getStr("name");
}

public M setSort(java.lang.Integer sort) {
set("sort", sort);
return (M)this;
}

public java.lang.Integer getSort() {
return getInt("sort");
}

public M setRemark(java.lang.String remark) {
set("remark", remark);
return (M)this;
}

public java.lang.String getRemark() {
return getStr("remark");
}

}

2017-12-13 22:31

@JFinal 波总, jfinal3.3是否支持JSON转javabean(即自动生成带get set方法的model),比如:String paraJson = HttpKit.readData(getRequest());
SaleClientele vo = JSON.parseObject(paraJson, SaleClientele.class); 目前3.2不支持,json转生成baseMode,即javabean model,值为空;如果转为换为自己定义的javabean,肯定没有问题。json转换成自动生成javabean model,目前没有找到好的解决方法,请问波总有好的解决办法吗?请赐教,谢谢

2017-10-13 09:13

@nbjgl 单表查询加索引+缓存应该不会慢,但如果是多表联合查询,关联又比较多,就要考虑搜索了

2017-10-13 09:06

@ThreeX 异常是你自己控制的,你如果不吃掉,框架就一直往外抛异常