org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.Reflecti

来源:互联网 发布:python 2.7.11 32位 编辑:程序博客网 时间:2024/04/28 16:01
<select id="queryPlanClustersCount" resultType="java.lang.Integer" parameterType="java.lang.String">    SELECT COUNT(DISTINCT cluster_name) AS total    FROM plan_cluster    <where>        <if test="product != null and product != ''">            product_class = #{product}        </if>    </where>    /*WHERE product_class = #{product}*/</select>
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'product' in 'class java.lang.String' 
结论: 
把if判断标签去掉就可以了,标签是针对JAVABEAN或者MAP的,String不能用标签
单用String 用if判断就会报这个错误 并且没办法解决 目前不支持。 把标签去了,那就用不了动态语句了
0 0
原创粉丝点击