updateArea测试不通过
为什么我的AreaDaoTest类的updateArea测试不通过,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'
为什么我的AreaDaoTest类的updateArea测试不通过,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-24
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;
// 权重
private Integer priority;
// 创建时间
private Date createTime;
//更新时间
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;
}
举报