org.apache.ibatis.ognl.OgnlException: source is null for getProperty(null, "mil_id")
2018-01-31 18:12
621 查看
org.apache.ibatis.ognl.OgnlException: source is null for getProperty(null, "mil_id")
今天遇到这个问题, 经过一番探索, 发现是mybatis 查询语句的问题 ,其中我有个条件查询语句 动态写参数, (由于一些原因copy部分代码 )
其中equipmentCode是关联表中的字段,所有我用energyStation对象准备去点出来,原来的代码
<select id="getEquipmentInfoList" resultMap="equipmentInfoMap">
<where>
<if test="energyStation.energyStationName != null and energyStation.energyStationName !=''">
and es.energy_station_name =#{energyStation.energyStationName}
</if>
</where>
</select>
改之后
<select id="getEquipmentInfoList" resultMap="equipmentInfoMap">
<where>
<if test="energyStationName != null and energyStationName
!=''">
and es.energy_station_name =#{energyStationName}
</if>
</where>
</select>
今天遇到这个问题, 经过一番探索, 发现是mybatis 查询语句的问题 ,其中我有个条件查询语句 动态写参数, (由于一些原因copy部分代码 )
其中equipmentCode是关联表中的字段,所有我用energyStation对象准备去点出来,原来的代码
<select id="getEquipmentInfoList" resultMap="equipmentInfoMap">
<where>
<if test="energyStation.energyStationName != null and energyStation.energyStationName !=''">
and es.energy_station_name =#{energyStation.energyStationName}
</if>
</where>
</select>
改之后
<select id="getEquipmentInfoList" resultMap="equipmentInfoMap">
<where>
<if test="energyStationName != null and energyStationName
!=''">
and es.energy_station_name =#{energyStationName}
</if>
</where>
</select>
相关文章推荐
- Caused by: org.apache.ibatis.ognl.OgnlException: source is null for getProperty(null, "id")
- root cause org.apache.ibatis.ognl.OgnlException: source is null for getProperty(null, "XXX")
- Caused by: org.apache.ibatis.ognl.OgnlException: source is null for getProperty(null, "list")
- ognl.OgnlException: source is null for getProperty(null, "0")
- Struts2 设置List值时出错:ognl.OgnlException: source is null for getProperty(null, "0")
- 解决异常ognl.OgnlException: source is null for getProperty(null, "token")
- Warning Error user.userId value userid 出现错误ognl.OgnlException: target is null for setProperty(null, "userid", [Ljava.lang.String;@19af9e98)
- ognl.OgnlException: target is null for setProperty(null, "y", [Ljava.lang.St
- ognl.OgnlException: target is null for setProperty(null, "x",)错误
- ognl.OgnlException: target is null for setProperty(null, "tkscName", [Ljava.lang.String;@1bf9980)
- ognl.OgnlException: target is null for setProperty(null, "description", [Ljava.lang.String;@12069f2
- ognl.OgnlException: target is null for setProperty(null, "y", [Ljava.lang.String;@1d57c7)
- org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'id' in 'cla
- ognl.OgnlException: target is null for setProperty(null, "x", [Ljava.lang.String;@1a4
- ognl.OgnlException: target is null for setProperty(null, "goodsSize", [Ljava.lang.String;@c3bb5。
- 解决ognl.OgnlException: target is null for setProperty(null, "authorized", [Ljava.lang.String;@1d7ce3)
- ognl.OgnlException: target is null for setProperty(null, "goodsSize", [Ljava.lang.String;@c3bb5。
- ognl.OgnlException: target is null for setProperty(null, "XX", [Ljava.lang.String;@10f8ee4)解决
- source is null for getProperty(null, "parentId")
- ognl.OgnlException: target is null for setProperty(null, "name", [Ljava.lang.String;@f6