波总,考虑过Model的级连属性么?
举例,如下面的代码
public abstract class BaseXXX<M extends BaseXXX<M>> extends Model<M> implements IBean {
public List<Material extends BaseMaterial> getMaterialEntries() {
return get("materials");
}
自动生成1对1 or 1对多 的属性,
这样写代码还是能更简洁,方便的
public List < Material > getMaterial() {
return new Material().find("select * from material where xxx.material_id = ?", getId());
}