Package org.nutz.dao.sql

Examples of org.nutz.dao.sql.Pojo


    return opt.getUpdateCount();
  }

  public int delete(Class<?> classOfT, long id) {
    Entity<?> en = holder.getEntity(classOfT);
    Pojo pojo = pojoMaker.makeDelete(en).append(Pojos.Items.cndId(en, id));
    pojo.addParamsBy(id);
    _exec(pojo);
    return pojo.getUpdateCount();
  }
View Full Code Here


    return pojo.getUpdateCount();
  }

  public int delete(Class<?> classOfT, String name) {
    Entity<?> en = holder.getEntity(classOfT);
    Pojo pojo = pojoMaker.makeDelete(en)
                .append(Pojos.Items.cndName(en, name))
                .addParamsBy(name);
    _exec(pojo);
    return pojo.getUpdateCount();
  }
View Full Code Here

    return pojo.getUpdateCount();
  }

  public <T> int deletex(Class<T> classOfT, Object... pks) {
    Entity<T> en = holder.getEntity(classOfT);
    Pojo pojo = pojoMaker.makeDelete(en).append(Pojos.Items.cndPk(en, pks));
    _exec(pojo);
    return pojo.getUpdateCount();
  }
View Full Code Here

    return opt.exec().getUpdateCount();
  }

  public <T> List<T> query(Class<T> classOfT, Condition cnd, Pager pager) {
    Pojo pojo = pojoMaker.makeQuery(holder.getEntity(classOfT))
                .append(Pojos.Items.cnd(cnd))
                .addParamsBy("*")
                .setPager(pager)
                .setAfter(_pojo_queryEntity);
    expert.formatQuery(pojo);
    _exec(pojo);
    return pojo.getList(classOfT);
  }
View Full Code Here

    _exec(pojo);
    return pojo.getList(classOfT);
  }

  public List<Record> query(String tableName, Condition cnd, Pager pager) {
    Pojo pojo = pojoMaker.makeQuery(tableName)
                .addParamsBy("*")
                .setPager(pager)
                .append(Pojos.Items.cnd(cnd));
    expert.formatQuery(pojo);
    pojo.setAfter(_pojo_queryRecord);
    _exec(pojo);
    return pojo.getList(Record.class);
  }
View Full Code Here

    return pojo.getList(Record.class);
  }

  public <T> T fetch(Class<T> classOfT, long id) {
    Entity<T> en = holder.getEntity(classOfT);
    Pojo pojo = pojoMaker.makeQuery(en)
                .append(Pojos.Items.cndId(en, id))
                .addParamsBy(id)
                .setAfter(_pojo_fetchEntity);
    _exec(pojo);
    return pojo.getObject(classOfT);
  }
View Full Code Here

    return pojo.getObject(classOfT);
  }

  public <T> T fetch(Class<T> classOfT, String name) {
    Entity<T> en = holder.getEntity(classOfT);
    Pojo pojo = pojoMaker.makeQuery(en)
                .append(Pojos.Items.cndName(en, name))
                .addParamsBy(name)
                .setAfter(_pojo_fetchEntity);
    _exec(pojo);
    return pojo.getObject(classOfT);
  }
View Full Code Here

    }
    return "";
  }

  public static Pojo pojo(JdbcExpert expert, Entity<?> en, SqlType type) {
    Pojo pojo = expert.createPojo(type);
    pojo.getContext().setFieldMatcher(FieldFilter.get(en.getType()));
    return pojo;
  }
View Full Code Here

    return pojo.getObject(classOfT);
  }

  public <T> T fetchx(Class<T> classOfT, Object... pks) {
    Entity<T> en = holder.getEntity(classOfT);
    Pojo pojo = pojoMaker.makeQuery(en)
                .append(Pojos.Items.cndPk(en, pks))
                .setAfter(_pojo_fetchEntity);
    _exec(pojo);
    return pojo.getObject(classOfT);
  }
View Full Code Here

  public NutPojoMaker(JdbcExpert expert) {
    this.expert = expert;
  }

  public Pojo makePojo(SqlType type) {
    Pojo pojo = expert.createPojo(type);

    return pojo;
  }
View Full Code Here

TOP

Related Classes of org.nutz.dao.sql.Pojo

Copyright © 2018 www.massapicom. 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.