XML mapping configuration file in MyBatis

Source: Internet
Author: User

XML mapping configuration file

The XML configuration file for MyBatis contains settings and attribute information that affect mybatis behavior very deeply. The advanced hierarchy of XML documents is as follows:


Properties



Settings

These and other important tweaks, he modifies the way MyBatis behaves at runtime. The following table describes the settings information, their meaning and default values:



Typealiases

A type alias is a short name that is named for the Java type. He is related to the configuration of XML and is used only to reduce the redundant parts of the class fully qualified name. For example:



Typehandlers

Whether MyBatis sets a parameter in a preprocessing statement or fetches a value from the result set, the type processor is used to convert the obtained value to the Java type in the appropriate way. The following table describes the default type processor.


You can override the type processor or create your own type processor to handle unsupported or nonstandard types. To do this, simply implement the Typehander interface (Org.mybatis.type). The new type processor is then mapped to the Java type, and there is an optional JDBC type. For example:

Objectfactory

MyBatis each time a new instance of the result object is created, he uses a objectfactory instance to complete. If the parameter mapping exists, the default objectfacotry does more work than instantiating the target class using the default constructor method or the constructor with parameters, and if you want to rewrite objectfacotry, you can create your own. Like what:


Plugins



Environments


TRansactionmanager





XML mapping configuration file in MyBatis

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.