增加生成器配置路径

This commit is contained in:
fengjun
2024-07-02 14:22:44 +08:00
parent 74e93ff72f
commit 85cdda2f93
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();
static {
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.setPassword("agmysqlroot");
}
public static String getProjectPath() {
return System.getProperty("user.dir");
}
//不考虑用户
static class Generator{
public static void main(String[] args) throws XMLParserException, SQLException, IOException, InterruptedException, InvalidConfigurationException {
String tableNames = "teacher";
String tableNames = "student";
String[] tableNameArray = tableNames.split(",");
for (String tableName : tableNameArray) {
GeneratorStarter.generate(tableName,jdbc);
@@ -36,8 +41,8 @@ public class GeneratorMain {
//考虑用户 ,同一个用户
static class GeneratorMultiple{
public static void main(String[] args) throws XMLParserException, SQLException, IOException, InterruptedException, InvalidConfigurationException {
String tableNames = "FA_VBILL_TRUCK,FA_VBILL_CUSTOM";
String tableSchema = "AG_SECP_SHHH";
String tableNames = "student";
String tableSchema = "";
String[] tableNameArray = tableNames.split(",");
for (String tableName : tableNameArray) {
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包路径
public static final String DOMAIN_PACKAGE = "com.ag.example.domain";
//pojo包路径