NutzCN Logo
问答 nutz sql 执行问题
发布于 2420天前 作者 xiejibiao 1560 次浏览 复制 上一个帖子 下一个帖子
标签:

实例化了一个对象,并且set 数据,setDelFlag 明明 set 的是 true ,可是 SQL 语句执行的时候,就是不对

// 添加赞赏记录
		Wb_Appreciate wb_Appreciate = new Wb_Appreciate();
		wb_Appreciate.setCreateAt((int) (System.currentTimeMillis() / 1000));
		wb_Appreciate.setMoney((money / 100) + "");
		wb_Appreciate.setPostId(postId);
		wb_Appreciate.setUserId(wb_User.getId());
		wb_Appreciate.setUserName(wb_User.getUserName());
		wb_Appreciate.setDelFlag(true);
		wb_Appreciate.setOrderNo(orderNo);
		wb_Appreciate.setPayStatus(1);
		wbAppreciateService.insert(wb_Appreciate);
NSERT INTO wb_appreciate(id,postId,userId,userName,money,createAt,orderNo,payStatus,opBy,opAt,delFlag) 
VALUES('9a8bbf223f8d4f13a33b0599039aafe8','17d958df1ec5406ebe825d9abd8521fd','8035d187f724429fb5427a03f0dda50e','落叶 ','1',1522493927,'ZS1522493917682',1,'',1522493931,false) 
3 回复

检查一下setter和getter

这是basemodel的代码

public abstract class BaseModel implements Serializable {
    private static final long serialVersionUID = 1L;
    @Column
    @Comment("操作人")
    @Prev(els = @EL("$me.uid()"))
    @ColDefine(type = ColType.VARCHAR, width = 32)
    private String opBy;

    @Column
    @Comment("操作时间")
    @Prev(els = @EL("$me.now()"))
    @ColDefine(type = ColType.INT)
    private Integer opAt;

    @Column
    @Comment("删除标记")
    @Prev(els = @EL("$me.flag()"))
    @ColDefine(type = ColType.BOOLEAN)
    private Boolean delFlag;

    public String toString() {
        return String.format("/*%s*/%s", super.toString(), Json.toJson(this, JsonFormat.compact()));
    }

    public Boolean flag() {
        return false;
    }

    public Integer now() {
        return (int) (System.currentTimeMillis() / 1000);
    }

    public String uid() {
        try {
            Subject subject = SecurityUtils.getSubject();
            if (subject != null) {
                return Strings.sNull(subject.getSession(true).getAttribute("uid"));
            }
        } catch (Exception e) {
        }
        return "";
    }

    public String getOpBy() {
        return opBy;
    }

    public void setOpBy(String opBy) {
        this.opBy = opBy;
    }

    public Integer getOpAt() {
        return opAt;
    }

    public void setOpAt(Integer opAt) {
        this.opAt = opAt;
    }

    public Boolean getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(Boolean delFlag) {
        this.delFlag = delFlag;
    }

    public String uuid() {
        return R.UU32().toLowerCase();
    }
}

flag方法返回false了

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