我是这样使用的
@Test
public void t7() {
Dao dao = dbTools.getDao();
Record r = dao.fetch("sunyu_resource", Cnd.where("id", "=", "21326916-33a1-4d10-a29c-d156a1bc7b76"));
System.out.println(r.getString("name"));
}
后台日志
[DEBUG][2016-09-30 08:34:42.633]org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388)SELECT * FROM sunyu_resource WHERE id=? LIMIT 0, 1
| 1 |
|--------------------------------------|
| 21326916-33a1-4d10-a29c-d156a1bc7b76 |
For example:> "SELECT * FROM sunyu_resource WHERE id='21326916-33a1-4d10-a29c-d156a1bc7b76' LIMIT 0, 1 "
其实我是想要
SELECT name FROM sunyu_resource WHERE id='21326916-33a1-4d10-a29c-d156a1bc7b76' LIMIT 0, 1
只要查询name字段就可以了,不想查询所有字段
怎么破?