org.nutz.service.IdEntityService类
加入以下方法,让写法更酷更简便些,这些方法也可以省去传Class<?> classOfT这步:
public Entity<T> create(boolean dropIfExists) {
return dao().create(getEntityClass(), dropIfExists);
}
public boolean drop() {
return dao().drop(getEntityClass());
}
public int each(Condition cnd, Each<T> callback) {
return dao().each(getEntityClass(), cnd, callback);
}
public int each(Condition cnd, Pager pager, Each<T> callback) {
return dao().each(getEntityClass(), cnd, pager, callback);
}
public boolean exists() {
return dao().exists(getEntityClass());
}
public T fetch() {
return dao().fetch(getEntityClass());
}
public int func(String funcName, String fieldName) {
return dao().func(getEntityClass(), funcName, fieldName);
}
public int func(String funcName, String fieldName, Condition cnd) {
return dao().func(getEntityClass(), funcName, fieldName, cnd);
}
public T getObject(ResultSet rs, FieldMatcher fm) {
return dao().getObject(getEntityClass(), rs, fm);
}
public void insert(Chain chain) {
dao().insert(getEntityClass(), chain);
}
public List<T> query(Condition cnd) {
return dao().query(getEntityClass(), cnd);
}