Code generator (MGP)
Panshi project using apache mybatis-generator component implementation code generated automatically, which greatly improves development efficiency, reduce duplication of code work. code generate according to database table structure, and automatically complete code, sql statements, permissions and functions.
Generator configuration
Configuration file located in MGP/resources/generatorConfig.xml
, it is used to configure code generate rules and specifies data tables need to be generated.
updateOptional
<!-- updateOptional: yes/no, default: yes -->
<property name="updateOptional" value="no"/>
<!-- Controller use updateOptional instead update by default: yes/no, default: yes -->
<property name="updateOptionalUse" value="no"/>
updateOptional specifies whether use updateOptional method instead of default update data operation method, update method default update entity non-null fields, this option is unavailable in scenarios where fields need to be reset to NULL. In order to remedy this defect, updateOptional method complete full update of data table by configuring SQL updatable fields in Mapper.xml. the method is a general full update method, mainly use for modify main body data of table,such as article edit, user edit scenarios, and not recommended for scenario of updating individual fields.
updateOptionalUse configuration item used to configure controller edit method call updateOptional, value yes By default. value setting is no to disable updateOptional and controller invoke to update method.