快速开始
初始化sql
数据库的建表sql
CREATE TABLE `user` (
`id` bigint(20) DEFAULT NULL COMMENT '自增id',
`name` varchar(255) DEFAULT NULL COMMENT '姓名',
`mobile` bigint(255) DEFAULT NULL COMMENT '手机号'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户表';
使用前
正常如果不适用插件的话生成带注释的bean是这样的:
package entity;
public class User {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column user.id
*
* @mbg.generated Sun Feb 02 14:17:08 CST 2020
*/
private Long id;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column user.name
*
* @mbg.generated Sun Feb 02 14:17:08 CST 2020
*/
private String name;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column user.mobile
*
* @mbg.generated Sun Feb 02 14:17:08 CST 2020
*/
private Long mobile;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column user.id
*
* @return the value of user.id
*
* @mbg.generated Sun Feb 02 14:17:08 CST 2020
*/
public Long getId() {
return id;