欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

解決MyBatis報(bào)錯(cuò):There is no getter for property named'Xxx'in'class xxx.xxx.Xxx'

 更新時(shí)間:2024年08月08日 10:14:08   作者:溫柔哥`  
這篇文章主要介紹了解決MyBatis報(bào)錯(cuò):There is no getter for property named'Xxx'in'class xxx.xxx.Xxx'問(wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教

問(wèn)題

org.apache.ibatis.exceptions.PersistenceException: 
### Error querying database.  Cause: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'ProName' in 'class com.smbms.pojo.Provider'
### Cause: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'ProName' in 'class com.smbms.pojo.Provider'

解決方法

這個(gè)錯(cuò)誤提示你的實(shí)體類(lèi)的某個(gè)屬性沒(méi)有g(shù)et方法那么你的 

問(wèn)題可能有以下三種

  • 1.在實(shí)體類(lèi)中的該屬性名字寫(xiě)錯(cuò)了
  • 2.在實(shí)體類(lèi)中的該屬性沒(méi)有寫(xiě)get方法
  • 3.在xxxMapper.xml文件中的該屬性名字寫(xiě)錯(cuò)了

下面是我的錯(cuò)誤之處

大家可以看到注釋的部分為我之前的寫(xiě)錯(cuò)名字的屬性,注釋下面那行為修改后的

       <select id="queryByIdAndProName" resultType="com.smbms.pojo.Provider">
            select *
            from smbms_provider
            <where>
                <if test="id != null and id != ''">
                    and id = #{id}
                </if>
<!--             <if test="ProName != null and id != ''">-->
                 <if test="proName != null and id != ''">
                     and proName like concat('%',#{proName},'%')
                 </if>
            </where>
        </select>

再次運(yùn)行之后的結(jié)果就是正確的了

總結(jié)

以上為個(gè)人經(jīng)驗(yàn),希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論