Search in sources :

Example 1 with Each

use of org.nutz.lang.Each in project nutz by nutzam.

the class NutDao method each.

public int each(String tableName, Condition cnd, Pager pager, Each<Record> callback) {
    Pojo pojo = pojoMaker.makeQuery(tableName).addParamsBy("*").setPager(pager).append(Pojos.Items.cnd(cnd));
    expert.formatQuery(pojo);
    pojo.setAfter(_pojo_eachRecord);
    pojo.getContext().attr(Each.class.getName(), callback);
    pojo.getContext().attr("dao-cache-skip", "true");
    _exec(pojo);
    return pojo.getInt();
}
Also used : Each(org.nutz.lang.Each) Pojo(org.nutz.dao.sql.Pojo)

Example 2 with Each

use of org.nutz.lang.Each in project nutz by nutzam.

the class NutDao method each.

public <T> int each(Class<T> classOfT, Condition cnd, Pager pager, Each<T> callback) {
    Pojo pojo = pojoMaker.makeQuery(holder.getEntity(classOfT)).append(Pojos.Items.cnd(cnd)).addParamsBy("*").setPager(pager).setAfter(_pojo_queryEntity);
    expert.formatQuery(pojo);
    pojo.setAfter(_pojo_eachEntity);
    pojo.getContext().attr(Each.class.getName(), callback);
    pojo.getContext().attr("dao-cache-skip", "true");
    _exec(pojo);
    return pojo.getInt();
}
Also used : Each(org.nutz.lang.Each) Pojo(org.nutz.dao.sql.Pojo)

Aggregations

Pojo (org.nutz.dao.sql.Pojo)2 Each (org.nutz.lang.Each)2