NutzCN Logo
问答 在数据库中字段加了@J4EIgnore的问题
发布于 2325天前 作者 qq_09dec3d3 1758 次浏览 复制 上一个帖子 下一个帖子
标签:

EXCEL表中不存在该字段,但为了变成的方便,在数据库中添加了,但不再操作EXCEL导出,在操作数据表中,该字段依旧被忽略,无法显示,这是为什么,不能做到两全吗?

 public Object listdiff(HttpSession session)
    {
     List<subpon> subPon=null;
     subPon=Daos.ext(dao, FieldFilter.create(subpon.class, "^id|newponk|gjz|address|ywhm$")).query(subpon.class,Cnd.where("gh","=",session.getAttribute("gh")).and(new Static("((newponk is null and gjz is not null) or (newponk is not null and gjz is null))"))); 
     return subPon;
    }
@J4EIgnore
private String gjz;
20 回复

发表中不能上传图片

没看懂→_→

dao并不会关心@J4E注解

我的意思就是这句查询语句中 subPon=Daos.ext(dao, FieldFilter.create(subpon.class, "^id|newponk|gjz|address|ywhm$")).query(subpon.class,Cnd.where("gh","=",session.getAttribute("gh")).and(new Static("((newponk is null and gjz is not null) or (newponk is not null and gjz is null))"))); 只显示了Iid、newponk、address、ywhm,无gjz

subPon是List,起码用复数啊

无gjz是什么意思?? subpon.getGjz == null ?

呵呵,我用的AJAX,返回数据中只有四项,无GJZ

我觉得好奇怪

按你的sql条件, newpoink不为null的时候,结果集里面的gjz就是null啦

哦,我知道了,这个字段返回结果为空

另外, 那是过滤java属性的,不是过滤数据库字段的

鉴于你代码里面各种大小不分,单复数不分, 估计又是乱套了

没有润涛,我在做测试时,设置了该字段为空

奇怪,为空就不返回数据?

... 你的sql条件就是这样写的啊

但在前台,根本就没有gjz这一项,只有四项,恰好这一项的数据目前都为空

newponk is not null and gjz is null // newponk有值的时候, gjz肯定是null 啊

我在getGjz把NULL设置为"空"了,这样就有了吧

你指的是返回给前端的json里面, 即使gjz是null, 也需要输出?

对,需要这样

@Ok("json:full")
添加回复
请先登陆
回到顶部