增加生成器配置路径 #2

Merged
fengjun merged 1 commits from fengjun into master 2024-07-02 14:23:16 +08:00
2 changed files with 10 additions and 6 deletions

View File

@@ -18,15 +18,20 @@ public class GeneratorMain {
private static final JdbcParams jdbc = new JdbcParams(); private static final JdbcParams jdbc = new JdbcParams();
static { static {
jdbc.setDriveClass("com.mysql.cj.jdbc.Driver"); jdbc.setDriveClass("com.mysql.cj.jdbc.Driver");
jdbc.setUrl("jdbc:mysql://122.5.19.222:3909/ag_devmysql"); jdbc.setUrl("jdbc:mysql://192.168.1.188:3306/ag_one_test");
jdbc.setUsername("root"); jdbc.setUsername("root");
jdbc.setPassword("agmysqlroot"); jdbc.setPassword("agmysqlroot");
} }
public static String getProjectPath() {
return System.getProperty("user.dir");
}
//不考虑用户 //不考虑用户
static class Generator{ static class Generator{
public static void main(String[] args) throws XMLParserException, SQLException, IOException, InterruptedException, InvalidConfigurationException { public static void main(String[] args) throws XMLParserException, SQLException, IOException, InterruptedException, InvalidConfigurationException {
String tableNames = "teacher"; String tableNames = "student";
String[] tableNameArray = tableNames.split(","); String[] tableNameArray = tableNames.split(",");
for (String tableName : tableNameArray) { for (String tableName : tableNameArray) {
GeneratorStarter.generate(tableName,jdbc); GeneratorStarter.generate(tableName,jdbc);
@@ -36,8 +41,8 @@ public class GeneratorMain {
//考虑用户 ,同一个用户 //考虑用户 ,同一个用户
static class GeneratorMultiple{ static class GeneratorMultiple{
public static void main(String[] args) throws XMLParserException, SQLException, IOException, InterruptedException, InvalidConfigurationException { public static void main(String[] args) throws XMLParserException, SQLException, IOException, InterruptedException, InvalidConfigurationException {
String tableNames = "FA_VBILL_TRUCK,FA_VBILL_CUSTOM"; String tableNames = "student";
String tableSchema = "AG_SECP_SHHH"; String tableSchema = "";
String[] tableNameArray = tableNames.split(","); String[] tableNameArray = tableNames.split(",");
for (String tableName : tableNameArray) { for (String tableName : tableNameArray) {
GeneratorStarter.generate(tableName,tableSchema,jdbc); GeneratorStarter.generate(tableName,tableSchema,jdbc);
@@ -55,9 +60,8 @@ public class GeneratorMain {
// } // }
// } // }
//基础路径 //基础路径
public static final String BASE_PATH = "E:\\IdeaProject\\AG_MYSQL_PLATFORM3.0\\IlogDynamicModule\\src\\main\\"; public static final String BASE_PATH = getProjectPath()+"\\IlogDynamicModule\\src\\main\\";
//domain包路径 //domain包路径
public static final String DOMAIN_PACKAGE = "com.ag.example.domain"; public static final String DOMAIN_PACKAGE = "com.ag.example.domain";
//pojo包路径 //pojo包路径