There is no getter for property named in ' Class Java.lang.String '

Source: Internet
Author: User

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 '

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.