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

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

updateArea測(cè)試不通過

為什么我的AreaDaoTest類的updateArea測(cè)試不通過,org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'NULL' in 'class com.imooc.demo1.entity.Area'

正在回答

3 回答

大概意思是說你有一個(gè)參數(shù)為空,建議您先把代碼貼出來

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

我看你代碼沒有錯(cuò)呀,數(shù)據(jù)庫設(shè)計(jì)怎么樣呢?ResultMap配置(數(shù)據(jù)庫跟實(shí)體類的映射配置)還有你試過DeBug找沒?

0 回復(fù) 有任何疑惑可以回復(fù)我~
public?void?updateArea(){???
?????Area?area?=?new?Area();?????
???????area.setAreaName("西苑");????
???????????area.setAreaId(3);?????
??????????????area.setLastEditTime(new?Date());???
???????????????????int?effectedNum?=?areaDao.updateArea(area);??
?????????????????????????assertEquals(1,effectedNum);??
??????????????????????????}

<update id="updateArea" parameterType="com.imooc.demo1.entity.Area">

? ? ? ? UPDATE tb_area

? ? ? ? <set>

? ? ? ? ? ? <if test="areaName != NULL">area_name=#{areaName},</if>

? ? ? ? ? ? <if test="priority != NULL">priority=#{priority},</if>

? ? ? ? ? ? <if test="lastEditTime != NULL">last_edit_time=#{lastEditTime}</if>

? ? ? ? </set>

? ? ? ? WHERE area_id=#{areaId}

? ? </update>

public class Area {

? ? // 主鍵ID

? ? private Integer areaId;

? ? // 名稱

? ? private String areaName;

? ? // 權(quán)重

? ? private Integer priority;

? ? // 創(chuàng)建時(shí)間

? ? private Date createTime;

? ? //更新時(shí)間

? ? private Date lastEditTime;


? ? public Integer getAreaId() {

? ? ? ? return areaId;

? ? }


? ? public void setAreaId(Integer areaId) {

? ? ? ? this.areaId = areaId;

? ? }


? ? public String getAreaName() {

? ? ? ? return areaName;

? ? }


? ? public void setAreaName(String areaName) {

? ? ? ? this.areaName = areaName;

? ? }


? ? public Integer getPriority() {

? ? ? ? return priority;

? ? }


? ? public void setPriority(Integer priority) {

? ? ? ? this.priority = priority;

? ? }


? ? public Date getCreateTime() {

? ? ? ? return createTime;

? ? }


? ? public void setCreateTime(Date createTime) {

? ? ? ? this.createTime = createTime;

? ? }


? ? public Date getLastEditTime() {

? ? ? ? return lastEditTime;

? ? }


? ? public void setLastEditTime(Date lastEditTime) {

? ? ? ? this.lastEditTime = lastEditTime;

? ? }


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

舉報(bào)

0/150
提交
取消

updateArea測(cè)試不通過

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

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

幫助反饋 APP下載

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

公眾號(hào)

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