There is no getter for property named in 'class java. lang. string', java. lang. String
Preface: Unfortunately, we also encountered "There is no getter for property named in 'class java. lang. string' "error. Du Niang found many consistent articles. However, the statement remains to be discussed, but it also gives me some reference.
Planting trees by others
Let's see this article about There is no getter for property named '**' in 'class java. lang. String.
You cannot set the parameter to the name in bean. If the input type is String, you must change the parameter to [_ parameter]. the modified SQL statement is as follows (no matter what your parameter is, change it to "_ parameter ")
Otherwise, it doesn't mean
<select id="getRiskMember" resultMap="BaseResultMap" parameterType="String">
For such statements, the parameters in xml must be "_ parameter ".
Let me ride the cooler
View my arguments
<select id="getMoneyTransferByAttr1" parameterType="String" resultMap="BaseResultMap"> <include refid="selectMoneyTransfer" /> and attr1 = #{attr1} </select>
There is no problem with this method at runtime. Pay attention to parameterType = "String", and attr1 =#{ attr1 }.
So under what circumstances will the "There is no getter for property named in 'class java. lang. string'" error occur?
In this case:
<select id="getRiskMember" resultMap="BaseResultMap" parameterType="String"> <include refid="selectMember"/> and safetylevel > 1 and stauts = 1 <if test="username != null"> and username = #{username} </if> </select>
Note that "There is no getter for property named in 'class java. lang. string ', rather than the error that occurs when and username = # {username.
Of course, the solution is still described by the "noku_ln10" blogger. It will be okay if it is changed to this situation.
<select id="getRiskMember" resultMap="BaseResultMap" parameterType="String"> <include refid="selectMember"/> and safetylevel > 1 and stauts = 1 <if test="_parameter != null"> and username = #{username} </if> </select>
Copyright Disclaimer: All blogs on this site are original articles of qing_gee. If you need to reference and repost, you only need to specify the source and original link.