JavaMybatis ing property, advanced ing, javamybatis ing Property

Source: Internet
Author: User

JavaMybatis ing property, advanced ing, javamybatis ing Property

SQL attributes of the ing file:

Id: identifier (generally the dao layer method name)

ResultType: SQL return type

ResultMap: ing type

ParameterType: parameter type

UseGeneratedKeys = "true" keyProperty = "id": Put the last auto-increment id back after the add operation is completed (Note: After the object is added, the id attribute of the object will automatically have a value)

ResultMap advanced ing:

Super class (class in class) association:

<ResultMap type = "entity type" id = "identifier">

<Id property = "id" column = "id"/>

<Result property = "" column = "database column"/>

<Association property = "attributes of class objects in Entity classes" javaType = "types of classes">

<Result property = "attribute" column = "database column"/>

</Association>

</ResultMap>

One-to-multiple: collection

<ResultMap type = "entity type" id = "identifier">

<Id property = "id" column = "id"/>

<Result property = "" column = "database column"/>

<Collection property = "Object Class collection object" ofType = "set type">

<Result property = "attribute" column = "database column"/>

</Collection>

</ResultMap>

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.