Summary of common knowledge in Java development

Source: Internet
Author: User

1, MyBatis ID write-back: There is a business in the development process, the business object itself is a table, business object extension information is another table, here in the new when the business object table to insert a piece of data, and then the Business Object Extension table to insert the extension information, which is used here ID write-Back in Mybaitis

Liezi:

Session.insert ("mm.xxx", map);//Insert business object information corresponding Sql<insert id= "xxx" parametertype= "Java.util.Map" ><selectkey Resulttype= "Java.lang.Long" keyproperty= "Backid" order= "before" >select seq_id. Nextval as Backid from Dual</selectkey>insert into business object Table (ID,...) VALUES (#{backid},... </insert> after the first step, Mybaitis automatically writes back the Backid back to the incoming map. The map in the following code automatically contains the ID of the new business object, which is Backidsession.insert ("mm.yyy", map);//Save Extended object information


Summary of common knowledge in Java development

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.