Summary of the realization of dynamic field preservation in the main table

To those in need.

 

Environment: jdbctemplate, mysql, java

 

Key points:

1. The page element is defined as dynamicCol_id value_dictionary key_dictionary value, and the value is split

2. The sub-table obtains the main table id, and when it is added, check the maximum id+1 of the main table as the associated field id of the sub-table. To determine whether to add or modify is not based on the id empty as a condition, but add an isadd parameter to determine

3. When saving the main table, exclude parameters starting with dynamic

4. Different data dictionary values ​​of the sub-table are placed in the same sub-table field and value, such as typecode and typevalue

5. To dynamically add page elements, first delete the previous dynamic elements, and then add

6. When modifying, delete the sub-table first and then insert the sub-table

Guess you like

Origin blog.csdn.net/humors221/article/details/110219100