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'
2019-02-25
大概意思是說你有一個(gè)參數(shù)為空,建議您先把代碼貼出來
2019-02-26
我看你代碼沒有錯(cuò)呀,數(shù)據(jù)庫設(shè)計(jì)怎么樣呢?ResultMap配置(數(shù)據(jù)庫跟實(shí)體類的映射配置)還有你試過DeBug找沒?
2019-02-25
<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;
? ? }