MyBatis Generator使用com.mysql.cj.jdbc.Driver
Mybatis Generator 1.3.5
新建了一个decision库,并创建了一张user表
import org.apache.commons.lang3.StringUtils; import org.mybatis.generator.api.MyBatisGenerator; import org.mybatis.generator.config.*; import org.mybatis.generator.internal.DefaultShellCallback; import com.google.common.base.CaseFormat; import java.text.SimpleDateFormat; import java.util.*; import static com.tydt.decision.core.ProjectConstant.*; public class CodeGenerator { //JDBC配置,请修改为你项目的实际配置 private static final String JDBC_URL = "jdbc:mysql://localhost:3306/decision?serverTimezone=GMT%2B8&characterEncoding=utf8"; private static final String JDBC_USERNAME = "root"; private static final String JDBC_PASSWORD = "root"; private static final String JDBC_DIVER_CLASS_NAME = "com.mysql.cj.jdbc.Driver"; private static final String PROJECT_PATH = System.getProperty("user.dir");//项目在硬盘上的基础路径 private static final String TEMPLATE_FILE_PATH = PROJECT_PATH + "/src/test/resources/generator/template";//模板位置 private