Beispiel #1
0
 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);
 }
Beispiel #2
0
 public Record fetch(String tableName, Condition cnd) {
   Pojo pojo =
       pojoMaker
           .makeQuery(tableName)
           .append(Pojos.Items.cnd(cnd))
           .addParamsBy("*")
           .setPager(createPager(1, 1))
           .setAfter(_pojo_fetchRecord);
   expert.formatQuery(pojo);
   _exec(pojo);
   return pojo.getObject(Record.class);
 }
Beispiel #3
0
 public <T> T fetch(Class<T> classOfT, Condition cnd) {
   Pojo pojo =
       pojoMaker
           .makeQuery(holder.getEntity(classOfT))
           .append(Pojos.Items.cnd(cnd))
           .addParamsBy("*")
           .setPager(createPager(1, 1))
           .setAfter(_pojo_fetchEntity);
   expert.formatQuery(pojo);
   _exec(pojo);
   return pojo.getObject(classOfT);
 }
Beispiel #4
0
 public <T> T fetch(Class<T> classOfT, long id) {
   Entity<T> en = holder.getEntity(classOfT);
   if (en.getIdField() == null) throw new DaoException("Need @Id for " + classOfT);
   Pojo pojo =
       pojoMaker
           .makeQuery(en)
           .append(Pojos.Items.cndId(en, id))
           .addParamsBy(id)
           .setAfter(_pojo_fetchEntity);
   _exec(pojo);
   return pojo.getObject(classOfT);
 }
Beispiel #5
0
 public <T> T fetch(Class<T> classOfT, String name) {
   if (name == null) throw new IllegalArgumentException("name MUST NOT NULL!");
   Entity<T> en = holder.getEntity(classOfT);
   if (en.getNameField() == null) throw new DaoException("Need @Name for " + classOfT);
   Pojo pojo =
       pojoMaker
           .makeQuery(en)
           .append(Pojos.Items.cndName(en, name))
           .addParamsBy(name)
           .setAfter(_pojo_fetchEntity);
   _exec(pojo);
   return pojo.getObject(classOfT);
 }