MYBATIS12 Usermapper.xml

Source: Internet
Author: User

the input and output mappings complete the input mappings through ParameterType, and the output mappings are done through Resulttype and Resultmap. 1. 1parameterType Pass Pojo Wrapper object can define the contents of the Pojo wrapper type extension Mapper interface input parameters. Requirements: Custom query criteria Query user information, you need to enter query criteria to statement, query criteria can have user information, commodity information .... 1.1.1 Package Type

1.1.1mapper.xml

1.1.1mapper.java interface

Test

exception if parametertype specified property error, exception, getter method not found: org.apache.ibatis.exceptions.PersistenceException: # # # Error querying Database.    for property named ' Usercusto ' in ' Class Cn.itcast.mybatis.po.UserQueryVo ' for property Named ' Usercusto ' in ' Class Cn.itcast.mybatis.po.UserQueryVo '     Note: If future integration with spring is not done by calling the Getter method to get the property value, The Pojo property value is read strongly by reflection. 

1. 1resultType Specifies the type of output result (Pojo, simple Type, hashmap). ) to map SQL query results to Java objects. 1.1. 1 return Simple Type Mapper.xml

Mapper.java

Note If the query records the result set as a record and a column is reused, the return simple type is returned.

MYBATIS12 Usermapper.xml

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.