NutzCN Logo
问答 fetchlinks我的写法有问题吗?没读从表
发布于 2804天前 作者 Mr.Hu 1903 次浏览 复制 上一个帖子 下一个帖子
标签:
S_sale s = dao().fetch(S_sale.class, Cnd.where("billid", "=", billid));
		dao().fetchLinks(s, "^s_sale");
@Table("dbo.s_sale")
@View("dbo.a_s_sale")
public class S_sale {
	/**
	 * 0.业务系统单据类型
	 */
	private int bkind;
	/**
	 * 83.销售单据明细
	 */
	@Many(target = S_saledetail.class, field = "billid")
	private List<S_saledetail> s_saledetail;
	/**
	 * 83.销售合计
	 */
	@Many(target = S_salechild.class, field = "billid")
	private List<S_salechild> s_salechild;

日志

2017-03-13 07:07:18,437 org.nutz.dao.util.Daos.getColumnIndex(Daos.java:127) INFO  - Can not find @Column(lgs_rate) in table/view ()
2017-03-13 07:07:18,475 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) DEBUG - select * from(select row_number()over(order by __tc__)__rn__,* from(select top 1 0 __tc__,    * FROM dbo.a_s_sale  WHERE billid=?)t)tt where __rn__ > 0 order by __rn__ 
    |  1 |
    |----|
    | 41 |
  For example:> "select * from(select row_number()over(order by __tc__)__rn__,* from(select top 1 0 __tc__,    * FROM dbo.a_s_sale  WHERE billid=41)t)tt where __rn__ > 0 order by __rn__ "
2017-03-13 07:07:18,504 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'dateUtils'<class org.apache.commons.lang.time.DateUtils>
3 回复

单独用dao().fetchlinks(s,"s_saledetail")或者dao().fetchlinks(s,"s_salechild")都能读到从表 但是用正则匹配不到,对应的属性名没有问题吧.

我正则写的不对,我再好好看看吧

好吧 正确写法是S_sale s = dao().fetch(S_sale.class, Cnd.where("billid", "=", billid));
dao().fetchLinks(s, "^s_sale.*");

添加回复
请先登陆
回到顶部