miduo_server/jieling-dbgen/src/main/java/com/dbgen/LdbMain.java

40 lines
1.4 KiB
Java
Raw Normal View History

2020-04-17 16:28:31 +08:00
package com.dbgen;
import java.io.File;
import java.util.Map;
/**
2020-04-17 16:38:38 +08:00
* Description:
*
2020-04-17 16:28:31 +08:00
*
* mongo
2020-04-17 16:38:38 +08:00
* log map set list
2020-04-17 16:28:31 +08:00
* Visitor
*
2020-04-17 16:38:38 +08:00
* jdb.xml -> java bena -> mongo string
* activity
2020-04-17 16:28:31 +08:00
* Author: zsx
* CreateDate: 2020/4/15 17:02
*/
public class LdbMain {
public static File inputPath = new File("./jieling-dbgen");
public static File outputPath = new File("./serverlogic/src/main/java/com/ljsd/jieling/jbean");
public static void main(String args[]) throws Exception {
System.setProperty("star", "\n");
String xmlfile = "gameldb.xml";
File file = new File(inputPath, xmlfile);
System.out.println("db文件位置 --> " + file.getCanonicalPath());
Project currentProject = new Project(new Naming.Root(), XMLUtils.getRootElement(file));
for (Map.Entry<Naming,String> entry : Naming.child2Parent.entrySet()) {
for (Naming child : entry.getKey().getParent().getChildren()) {
if (child.getName().equals(entry.getValue())) {
entry.getKey().getChildren().addAll(child.getChildren());
break;
}
}
}
currentProject.make();
}
}