Search in sources :

Example 1 with IncrParam

use of com.baidu.unbiz.common.genericdao.param.IncrParam in project disconf by knightliao.

the class QueryGenerator method appendModifytoSQL.

/**
     * @param modifies
     * @param sb
     * @param params
     */
private void appendModifytoSQL(List<Modify> modifies, StringBuilder sb, List<Object> params) {
    for (Modify modify : modifies) {
        sb.append(modify.getColumn());
        Object value = modify.getValue();
        if (value instanceof IncrParam) {
            sb.append("=(").append(modify.getColumn()).append("+?),");
            params.add(((IncrParam) value).getValue());
        } else if (value instanceof ExpressionParam) {
            sb.append(',');
        } else {
            sb.append("=?,");
            params.add(value);
        }
    }
}
Also used : IncrParam(com.baidu.unbiz.common.genericdao.param.IncrParam) Modify(com.baidu.unbiz.common.genericdao.operator.Modify) BaseObject(com.github.knightliao.apollo.db.bo.BaseObject) ExpressionParam(com.baidu.unbiz.common.genericdao.param.ExpressionParam)

Aggregations

Modify (com.baidu.unbiz.common.genericdao.operator.Modify)1 ExpressionParam (com.baidu.unbiz.common.genericdao.param.ExpressionParam)1 IncrParam (com.baidu.unbiz.common.genericdao.param.IncrParam)1 BaseObject (com.github.knightliao.apollo.db.bo.BaseObject)1