@@ -0,0 +1,1548 @@
+package com.asksunny.codegen.data;%0D%0A%0D%0Aimport java.io.FileInputStream;%0D%0Aimport java.io.IOException;%0D%0Aimport java.io.InputStream;%0D%0Aimport java.io.InputStreamReader;%0D%0A%0D%0Aimport com.asksunny.codegen.CodeGenConfig;%0D%0Aimport com.asksunny.codegen.CodeGenerator;%0D%0Aimport com.asksunny.schema.Schema;%0D%0Aimport com.asksunny.schema.parser.SQLScriptParser;%0D%0A%0D%0Apublic class DataGenerator extends CodeGenerator %7B%0D%0A%0D%0A%09public DataGenerator() %7B%0D%0A%09%09super(new CodeGenConfig(), (Schema) null);%0D%0A%09%7D%0D%0A%0D%0A%09public DataGenerator(CodeGenConfig configuration) %7B%0D%0A%09%09super(configuration, (Schema) null);%0D%0A%09%7D%0D%0A%0D%0A%09@Override%0D%0A%09public void doCodeGen() throws IOException %7B%0D%0A%0D%0A%09%09String schemaFiles = configuration.getSchemaFiles();%0D%0A%09%09if (schemaFiles == null) %7B%0D%0A%09%09%09throw new IOException(%22Schema DDL file has not been specified%22);%0D%0A%09%09%7D%0D%0A%09%09Schema schema = null;%0D%0A%09%09String%5B%5D sfs = schemaFiles.split(%22%5C%5Cs*%5B,;%5D%5C%5Cs*%22);%0D%0A%09%09for (int i = 0; i %3C sfs.length; i++) %7B%0D%0A%09%09%09InputStream in = getClass().getResourceAsStream(String.format(%22/%25s%22, sfs%5Bi%5D));%0D%0A%09%09%09if (in == null) %7B%0D%0A%09%09%09%09in = new FileInputStream(sfs%5Bi%5D);%0D%0A%09%09%09%7D%0D%0A%09%09%09try %7B%0D%0A%09%09%09%09SQLScriptParser parser = new SQLScriptParser(new InputStreamReader(in));%0D%0A%09%09%09%09Schema schemax = parser.parseSql();%0D%0A%09%09%09%09if (schema == null) %7B%0D%0A%09%09%09%09%09schema = schemax;%0D%0A%09%09%09%09%7D else %7B%0D%0A%09%09%09%09%09schema.getAllEntities().addAll(schemax.getAllEntities());%0D%0A%09%09%09%09%7D%0D%0A%09%09%09%7D finally %7B%0D%0A%09%09%09%09in.close();%0D%0A%09%09%09%7D%0D%0A%09%09%7D%0D%0A%0D%0A%09%09BottomUpSchemaDataGenerator dataGenerator = new BottomUpSchemaDataGenerator();%0D%0A%09%09dataGenerator.setConfig(configuration);%0D%0A%09%09dataGenerator.generateData();%0D%0A%0D%0A%09%7D%0D%0A%0D%0A%7D%0D%0A

add data generator