59 lines
1.5 KiB
Java
59 lines
1.5 KiB
Java
|
|
public class Main {
|
|
|
|
/**
|
|
* @param args
|
|
*/
|
|
public static void main(String[] args)
|
|
{
|
|
//Chaser c = new Chaser();
|
|
//c.call("r");
|
|
if (args.length != 4)
|
|
{
|
|
System.out.println("Please specify table names and settings file!");
|
|
return;
|
|
}
|
|
|
|
long start = System.currentTimeMillis();
|
|
String templateName = args[0];
|
|
String mappingName = args[1];
|
|
String compName = args[2];
|
|
String fileName = args[3];
|
|
|
|
Settings settings = new Settings(fileName);
|
|
System.out.print("Loading settings...");
|
|
if (settings.loadSettings() == false)
|
|
{
|
|
System.out.println("The specified file could not be loaded.");
|
|
return;
|
|
}
|
|
System.out.println("done");
|
|
|
|
|
|
// System.out.println(settings.dependencies.size());
|
|
|
|
// for (int i = 0; i < settings.dependencies.size(); ++i)
|
|
// {
|
|
// System.out.println(settings.dependencies.get(i).toString());
|
|
// }
|
|
|
|
System.out.println("Cleaning data...");
|
|
Chaser chaser = new Chaser(settings.getDBSetting("dbname"),
|
|
settings.getDBSetting("username"),
|
|
settings.getDBSetting("password"),
|
|
templateName,
|
|
mappingName,
|
|
compName,
|
|
"");
|
|
long chaseStart = System.currentTimeMillis();
|
|
|
|
chaser.chase(settings.dependencies);
|
|
System.out.println(chaser.merged + " components were merged during the chase.");
|
|
long end = System.currentTimeMillis();
|
|
System.out.println("Operation completed in " + ((double)(end - chaseStart) / 1000.0) + " seconds.");
|
|
System.out.println("(total: " + ((double)(end - start) / 1000.0) + " seconds)");
|
|
|
|
}
|
|
|
|
}
|