# mybatisplus-generator **Repository Path**: bwhyman/mybatisplus-generator ## Basic Information - **Project Name**: mybatisplus-generator - **Description**: mybabtis-plus-generator - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-02-24 - **Last Updated**: 2022-05-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # mybabtis-plus-generator ### Introduction mybabtis-plus-generator is a plugin of mybatis-generator-plugin for integrating and generating mybatis-plus/lombok/spring annotations. ### Properties version, string, optional. The column name of the optimistic locker. Adding @Version annotation for the field. The column default value should be 0. OptimisticLockerInnerInterceptor should be provided in spring container. never, string, optional. The column name which the value generated by the database, such as update_time/create_time. Adding @TableField(updateStrategy = FieldStrategy.NEVER) annotation for the field. serializable, boolean, optional. The Model would implement Serializable. builder, boolean, optional. Adding @Builder and @AllArgsConstructor Model Examples ```java @Setter @Getter @ToString @NoArgsConstructor @TableName("user") public class User implements Serializable { private static final long serialVersionUID = 1L; private Long id; private String name; @TableField(updateStrategy = FieldStrategy.NEVER) private LocalDateTime updateTime; @Version private Integer version; } ``` Mapper Examples ```java @Repository @Mapper public interface UserMapper extends BaseMapper { } ``` ### Notice Set mybatis-generator-plugin overwrite is true. It will not generate mapper but model only. It will not generate mybatis-plus Primarykey annotation, which you should set it up in springboot properties. It will clean mappers' methods, because interface BaseMapper provide the common CURD operation. ### Configuration pom.xml ```xml org.mybatis.generator mybatis-generator-maven-plugin 1.4.0 true true com.github.bwhyman mybatisplus-generator 1.0.4 mysql mysql-connector-java {mysql.version} ``` generatorConfig.xml ```xml ........... ```