@Testpublic void test11(){
ArrayList<String> warings = new ArrayList<String>();
boolean overwrite=true;
String getConfig="/generatorConfig.xml";
File file = new File(test1.class.getResource(getConfig).getFile());
ConfigurationParser configurationParser = new ConfigurationParser(warings);
Configuration configuration=null;
try {
configuration = configurationParser.parseConfiguration(file);
} catch (IOException e) {
e.printStackTrace();
} catch (XMLParserException e) {
e.printStackTrace();
}
DefaultShellCallback defaultShellCallback = new DefaultShellCallback(overwrite);
MyBatisGenerator myBatisGenerator=null;
try {
myBatisGenerator = new MyBatisGenerator(configuration,defaultShellCallback,warings);
} catch (InvalidConfigurationException e) {
e.printStackTrace();
} try {
myBatisGenerator.generate(null);
} catch (SQLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
网友评论