TsukuyoMiya
2019-10-15 14:59
采纳率: 0%
浏览 2.0k

mybatis添加语句一直报空指针

传入的实体类

public class F728040Req {
    private Long clientId;
    private String prodId;
    private Long orderNum;

    public Long getClientId() {
        return clientId;
    }

    public void setClientId(Long clientId) {
        this.clientId = clientId;
    }

    public String getProdId() {
        return prodId;
    }

    public void setProdId(String prodId) {
        this.prodId = prodId;
    }

    public Long getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(Long orderNum) {
        this.orderNum = orderNum;
    }
}

SQL语句

<insert id="save">
        INSERT INTO PRODUCT_CONCERNS ( CLIENT_ID, PROD_ID, ORDER_NUM, CREATE_TIME)
        VALUES
            ( #{clientId}, #{prodId}, #{orderNum}, date_format(now(), '%Y%m%d%H%i%s'));
    </insert>

三个值全部都是有的,SQL语句也没有问题,放数据库就能跑,但就是报空指针的错误,即使把参数全都用常量替代,直接放数据库能成功,但这就是报空指针

4条回答 默认 最新

相关推荐 更多相似问题