Mybatis queries handle errors when passing Parameters

Source: Internet
Author: User

Mybatis queries handle input errors. the mysql database is used for processing, and mybatis is used for management. The java background is the spring framework, and the www.2cto.com console displays: 1 There is no getter for property named 'xxxx' in 'class java. lang. integer error. I checked it and thought there was an error in the parameter type of the SQL statement in xml. Later I changed it. No, I 'd like to change it online: <select id = "selectAllUserByName" resultType = "User" parameterType = "String"> SELECT id, name, login_name as loginName FROM sb_user where name like '% $ {_ parameter} %' </select> I changed the original name parameter to _ parameter. The method is to change the value of www.2cto.com from List <User> selectAllUserByName (String name) to List <User> selectAllUserByName (@ Param ("name") in the interface defined by mapper ") string name); can also solve the problem.

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.