Examples of Pojo


Examples of org.nutz.dao.sql.Pojo

  }

  public Pojo makeQuery(String tableName) {
    String[] ss = tableName.split(":");
    // String idFieldName = ss.length > 1 ? ss[1] : "*";//按id字段来统计,比较快
    Pojo pojo = makePojo(SqlType.SELECT);
    // pojo.append(Pojos.Items.wrap(idFieldName));//与org.nutz.dao.test.normal.QueryTest.query_records_pager()冲突
    pojo.append(Pojos.Items.wrap("*"));
    pojo.append(Pojos.Items.wrap("FROM"));
    pojo.append(Pojos.Items.wrap(ss[0]));
    return pojo;
  }
View Full Code Here

Examples of org.nutz.dao.sql.Pojo

    pojo.append(Pojos.Items.wrap(ss[0]));
    return pojo;
  }

  public Pojo makeDelete(Entity<?> en) {
    Pojo pojo = Pojos.pojo(expert, en, SqlType.DELETE);
    pojo.setEntity(en);
    pojo.append(Pojos.Items.wrap("FROM"));
    pojo.append(Pojos.Items.entityTableName());
    return pojo;
  }
View Full Code Here

Examples of org.nutz.dao.sql.Pojo

    pojo.append(Pojos.Items.entityTableName());
    return pojo;
  }

  public Pojo makeDelete(String tableName) {
    Pojo pojo = makePojo(SqlType.DELETE);
    pojo.append(Pojos.Items.wrap("FROM"));
    pojo.append(Pojos.Items.wrap(tableName));
    return pojo;
  }
View Full Code Here

Examples of org.nutz.dao.sql.Pojo

    pojo.append(Pojos.Items.wrap(tableName));
    return pojo;
  }

  public Pojo makeFunc(String tableName, String funcName, String colName) {
    Pojo pojo = makePojo(SqlType.SELECT);
    pojo.append(Pojos.Items.wrapf("%s(%s) FROM %s", funcName, colName, tableName));
    return pojo;
  }
View Full Code Here

Examples of org.nutz.dao.sql.Pojo

      }
      // '@Id' : 的自动后续获取
      else if (null != info.annId && info.annId.auto()) {
        MappingField idField = en.getField(info.name);
        String autoSql = "SELECT MAX($field) AS $field FROM $view";
        Pojo autoInfo = new SqlFieldMacro(idField, autoSql);
        autoInfo.setEntity(en);
        en.addAfterInsertMacro(autoInfo);
      }
    }
  }
View Full Code Here

Examples of org.nutz.dao.sql.Pojo

  public Pojo addUpdate() {
    return addUpdate(entity, myObj);
  }

  public Pojo addUpdate(Chain chain, Condition cnd) {
    Pojo pojo = dao.pojoMaker.makePojo(SqlType.UPDATE);
    pojo.setEntity(entity);
    pojo.append(Pojos.Items.entityTableName());
    pojo.append(Pojos.Items.updateFieldsBy(chain));
    pojo.append(Pojos.Items.cnd(cnd));
    pojoList.add(pojo);
    return pojo;
  }
View Full Code Here

Examples of org.nutz.dao.sql.Pojo

  public Pojo addUpdate(final Entity<?> en, final Object obj) {
    if (null == en)
      return null;

    Pojo pojo = dao.pojoMaker.makeUpdate(en, null)
                  .append(Pojos.Items.cndAuto(en, Lang.first(obj)))
                  .setOperatingObject(obj);
    pojoList.add(pojo);
    return pojo;
  }
View Full Code Here

Examples of org.nutz.dao.sql.Pojo

      newFM.setIgnoreNull(true);
    }
    final List<Pojo> re = new ArrayList<Pojo>(Lang.length(obj));
    Lang.each(obj, new Each<Object>() {
      public void invoke(int i, Object ele, int length) throws ExitLoop, LoopException {
        Pojo pojo = dao.pojoMaker.makeUpdate(en, ele)
                      .append(Pojos.Items.cndAuto(en, ele))
                      .setOperatingObject(ele);
        pojo.getContext().setFieldMatcher(newFM);
        re.add(pojo);
      }
    });
    pojoList.addAll(re);
View Full Code Here

Examples of org.nutz.dao.sql.Pojo

  public Pojo addUpdate(Condition cnd) {
    if (null == entity)
      return null;

    Pojo pojo = dao.pojoMaker.makeUpdate(entity, null).append(Pojos.Items.cnd(cnd));
    pojoList.add(pojo);
    return pojo;
  }
View Full Code Here

Examples of org.nutz.dao.sql.Pojo

  public Pojo addDeleteSelfOnly(long id) {
    if (null == entity)
      return null;

    Pojo pojo = dao.pojoMaker.makeDelete(entity);
    pojo.append(Pojos.Items.cndAuto(entity, myObj));
    pojo.addParamsBy(myObj);
    pojoList.add(pojo);
    return pojo;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.