第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

語(yǔ)法錯(cuò)誤,關(guān)于UserPasswordDOMapper的,請(qǐng)大神幫忙看下。。。

2019-06-03 21:56:29.690? WARN 36608 --- [nio-8080-exec-3] .m.m.a.ExceptionHandlerExceptionResolver : Resolved [org.springframework.jdbc.BadSqlGrammarException:?

### Error updating database.? Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

### The error may involve com.miaoshaproject.dao.UserPasswordDOMapper.insertSelective-Inline

### The error occurred while setting parameters

### SQL: insert into user_password

### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1]

上面是報(bào)的錯(cuò)


<insert?id="insertSelective"?parameterType="com.miaoshaproject.dataObject.UserPasswordDO">
??insert?into?user_password
??<trim?prefix="("?suffix=")"?suffixOverrides=",">
????<if?test="id?!=?null">
??????id,
????</if>
????<if?test="encrptPassword?!=?null">
??????encrpt_password,
????</if>
????<if?test="userId?!=?null">
??????user_id,
????</if>
??</trim>
??<trim?prefix="values?("?suffix=")"?suffixOverrides=",">
????<if?test="id?!=?null">
??????#{id,jdbcType=INTEGER},
????</if>
????<if?test="encrptPassword?!=?null">
??????#{encrptPassword,jdbcType=VARCHAR},
????</if>
????<if?test="userId?!=?null">
??????#{userId,jdbcType=INTEGER},
????</if>
??</trim>
</insert>

上面是我對(duì)應(yīng)的mappper里面的sql語(yǔ)句



https://img1.sycdn.imooc.com//5cf527ca00019b3f03750379.jpg

這個(gè)是本人創(chuàng)建的數(shù)據(jù)庫(kù)


class?UserPasswordDO?{
????private?Integer?id;

????private?String?encrptPassword;

????private?Integer?userId;

????public?UserPasswordDO(Integer?id,?String?encrptPassword,?Integer?userId)?{
????????this.id?=?id;
????????this.encrptPassword?=?encrptPassword;
????????this.userId?=?userId;
????}

????public?UserPasswordDO()?{
????????super();
????}

????public?Integer?getId()?{
????????return?id;
????}

????public?void?setId(Integer?id)?{
????????this.id?=?id;
????}

????public?String?getEncrptPassword()?{
????????return?encrptPassword;
????}

????public?void?setEncrptPassword(String?encrptPassword)?{
????????this.encrptPassword?=?encrptPassword?==?null???null?:?encrptPassword.trim();
????}

????public?Integer?getUserId()?{
????????return?userId;
????}

????public?void?setUserId(Integer?userId)?{
????????this.userId?=?userId;
????}
}

這是對(duì)應(yīng)的dataObjext?



難受啊

正在回答

4 回答

直接debug查userPassDO的值也行,debug用不慣的話,可以直接在UserPassDO.class里寫toString()方法,然后打印出來(lái)看看值

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

慕函數(shù)7093388 提問(wèn)者

確實(shí)好像是那邊有問(wèn)題,太感謝了!
2019-06-04 回復(fù) 有任何疑惑可以回復(fù)我~

請(qǐng)問(wèn)樓主最后怎么解決的嘞?

0 回復(fù) 有任何疑惑可以回復(fù)我~

往user_password表中插入的時(shí)候id是沒(méi)有默認(rèn)值的,視頻里是怎么直接插進(jìn)去的???

0 回復(fù) 有任何疑惑可以回復(fù)我~

你可以試著打印一下

userPasswordDO

對(duì)象看看里面的userid字段是不是空,可能之前建表的時(shí)候你沒(méi)有設(shè)初始值,然后就會(huì)這個(gè)亞子,

接下來(lái)看看UserDOMapper.xml里面的插入語(yǔ)句是否寫了主鍵返回獲得,把這個(gè)獲得的主鍵傳給UserModel,然后把這個(gè)UserModel傳給組裝userPassWordDO的方法里,看看行不行

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

語(yǔ)法錯(cuò)誤,關(guān)于UserPasswordDOMapper的,請(qǐng)大神幫忙看下。。。

我要回答 關(guān)注問(wèn)題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)