MyBatis Source Tracing 1--mapper Method Usage Analysis

Source: Internet
Author: User

The methods in Mapper are constructed as org.apache.ibatis.binding.mappermethod$methodsignature objects, from which you can learn how to use the Mapper method.

"Supported Special parameter types"

Rowbounds, Resulthandler, common parameters (variables used as SQL execution)

The common parameters can be a single model, a map of the query criteria, or directly one or more query criteria as parameters (multiple conditions will eventually be encapsulated in the framework for map use)

In addition, common parameters support adding @param annotations to modify parameter names, if not modified, the parameter names are 0, 1, and two.

When used, only two forms of 0 and param1 can be used if there are multiple parameters. (For example: SELECT * from TABLE WHERE column=#{0})

"Supported Return Types"

Model type, void, collection, array can be

Note that if the return type is map, add the annotation @mapkey (the Returnsmap attribute in the Methodsignature class is set to False, other consequences are not verified)

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.