use of org.nutz.dao.sql.Pojo in project nutz by nutzam.
the class DoUpdateRelationLinkVisitor method visit.
public void visit(Object obj, LinkField lnk) {
if (lnk instanceof ManyManyLinkField) {
ManyManyLinkField mm = (ManyManyLinkField) lnk;
Entity<?> en = opt.makeEntity(mm.getRelationName(), map);
Pojo pojo = opt.maker().makeUpdate(en, null);
pojo.setOperatingObject(map);
pojo.append(items);
opt.add(pojo);
}
}
use of org.nutz.dao.sql.Pojo in project nutz by nutzam.
the class NutPojoMaker method makeQuery.
@Override
public Pojo makeQuery(Entity<?> en) {
Pojo pojo = Pojos.pojo(expert, en, SqlType.SELECT);
pojo.setEntity(en);
pojo.append(Pojos.Items.queryEntityFields());
pojo.append(Pojos.Items.wrap("FROM"));
pojo.append(Pojos.Items.entityViewName());
return pojo;
}
use of org.nutz.dao.sql.Pojo in project nutz by nutzam.
the class NutPojoMaker method makeDelete.
@Override
public Pojo makeDelete(String tableName) {
Pojo pojo = makePojo(SqlType.DELETE);
pojo.append(Pojos.Items.wrap("FROM"));
pojo.append(Pojos.Items.wrap(tableName));
return pojo;
}
use of org.nutz.dao.sql.Pojo in project nutz by nutzam.
the class NutPojoMaker method makeQuery.
@Override
public Pojo makeQuery(String tableName, String fields) {
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(fields));
pojo.append(Pojos.Items.wrap("FROM"));
pojo.append(Pojos.Items.wrap(ss[0]));
return pojo;
}
use of org.nutz.dao.sql.Pojo in project nutz by nutzam.
the class NutPojoMaker method makeDelete.
@Override
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;
}
Aggregations