There is no getter for property named in & #39; class java. lang. String & #39;, java. lang. string

Source: Internet
Author: User

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.

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.