Tips-efficiently compile the ing between attributes and fields in the ibatis configuration file

Source: Internet
Author: User
Because we use ibatis for persistence, We need to write a lot of XML code. No need to generate toolsWhich affects the development efficiency more or less;

Especially when there are many fields in the table, the ing between the writing section and bean attributes is time-consuming, and troubleshooting is very troublesome;

I personally think that the ibatis configuration file is still relatively controllable, and the code is also quite nice. It can reduce a lot of junk code. As long as we make proper use of some gadgets, the development efficiency will also be very high!

Solution:ExcelDatabase Table Structure DesignSchema + ultraeditColumn Block Mode

You can also use the XML Special Editor xmlspy to replace the ultraedit column block mode.

1) first copy n rows in UE (the specific number of rows can be controlled by itself, generally the same as the number of fields in the table) the same ing code is shown in <result property = "" column = "" javatype = "" jdbctype = ""/>;

AndEnable the column Block Mode;

2) copy from Excel SchemaField ColumnAnd paste it to the property and column columns in the UE;

3) copy from Excel SchemaField Type ColumnAnd paste it to the jdbctype column in the UE;

4) Fill in the javatype field according to the jdbctype field. Here, you can use the UE search and replacement function to complete it;

5) disable the column Block Mode in ue, copy the completed ing code back to eclipse, and complete all mappings;

 

This ensures that our ing relationships are exactly the same as those in our schema design, and it is very convenient when troubleshooting;

In addition, insert and update operations can be completed in a similar way;

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.