Foreword : Unfortunately, also encountered "there is no getter for the property named in ' Class Java.lang.String '" error, degree Niang a bit, found a lot of consistent articles, but its argument is debatable, But also gave me some reference meaning.
Others plant trees
Look at there is no getter for property named ' * * ' in ' class java.lang.String this article, which says
It is found that the parameter cannot be set to the name in the bean, and if the incoming type is string, the parameter must be uniformly modified to [_parameter], and the modified SQL statement will be as follows (whatever your parameters are, change to "_parameter")
Not really, not to say
<select id="getRiskMember" resultMap="BaseResultMap" parameterType="String">
Such a statement, in the XML parameter must be "_parameter".
I'll take the shade.
Take a look at my argument.
<select id="getMoneyTransferByAttr1" parameterType="String" resultMap="BaseResultMap"> <include refid="selectMoneyTransfer" /> and attr1 = #{attr1} </select>
This kind of writing, at run time also completely no problem, note parametertype= "String", and attr1 = #{attr1}.
So what happens when "there is no getter for property named in ' Class Java.lang.String '" error?
In fact, in this case:
<select id="getRiskMember" resultMap="BaseResultMap" parameterType="String"> <include refid="selectMember"/> 1 1 <if test="username != null"> and username = #{username} </if> </select>
Note that the "there is no getters for the property named in ' Class Java.lang.String '" occurs when the if test= is validated, not the and username = #{username} Errors that occur when the
Of course, the solution is still "Noku_ln10" Bo Master said, change into this situation is OK
<select id="getRiskMember" resultMap="BaseResultMap" parameterType="String"> <include refid="selectMember"/> 1 1 <if test="_parameter != null"> and username = #{username} </if> </select>
Copyright notice: This site blog is qing_gee original article, if you need to quote, reprint, only need to indicate the source and the original link.
There is no getter for property named in ' Class Java.lang.String '