illustrate
Recently, when I installed idea on a new computer and started working, I suddenly discovered that the MybatisX-Generator of the MybatisX plug-in could not generate entity classes, but other files could be automatically generated.
text
After thinking again and again, I opened the idea on the old computer and used MybatisX to generate entity classes normally. So through the "control variable method", we compared the differences. Discovery: The MybatisX plug-in of idea on my old computer is version 1.5.4 and the one on the new computer is version 1.5.5. The idea on both computers is the same 2021.1.3 version.
So I thought it might be because this version of idea has compatibility issues with MybatisX 1.5.5. Later, I installed the mybatisX plug-in on the new computer to version 1.5.4, and sure enough, I could generate entity classes normally again!
So how to install the specified version of the Mybatis plug-in?
1. First uninstall the current version of MybatisX
从设置里找到Plugins或者直接双击shift键搜索Plugins
在已安装的插件中找到MybatisX插件,卸载当前版本的插件
如图(这里我已经换成了1.5.4版本的插件了)
2. Download the specified version of the plug-in
进入到MybatisX官网下载指定版本的插件(点击直接进入官网,下载指定版本的插件)
3. Install the downloaded plug-in through idea
点击小齿轮,再点击Install Plugin from Disk安装我们从官网下载的插件即可
4. Automatically generated entity classes
package com.lc.test.entity;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* @TableName tdm_test_table
*/
@Data
public class TdmTestTable implements Serializable {
/**
* 主键
*/
private Integer fid;
/**
* 业务日期
*/
private Date bizdate;
/**
* 公司编码
*/
private String companyCode;
/**
* 公司名称
*/
private String companyName;
/**
* 备注
*/
private String remark;
/**
* 创建人
*/
private String creatorName;
/**
* 创建时间
*/
private Date createTime;
private static final long serialVersionUID = 1L;
}
Conclusion
After installation, you should restart idea. After restarting, we will find that entity classes can be generated normally.