版本:3.6
Connected to the target VM, address: '127.0.0.1:8725', transport: 'socket'
2019-03-15 10:55:58:471 INFO [com.alibaba.druid.pool.DruidDataSource] {dataSource-1} inited
2019-03-15 10:55:58:602 DEBUG [druid.sql.Statement] {conn-10001, stmt-20000} executed. select * from FNE_COLLEGES_BILL_INFO where rownum < 1
2019-03-15 10:55:58:614 DEBUG [druid.sql.Statement] {conn-10001, stmt-20001} executed. select * from FNE_COLLEGES_BUSDATA where rownum < 1
2019-03-15 10:55:58:618 DEBUG [druid.sql.Statement] {conn-10001, stmt-20002} executed. select * from FNE_COLLEGES_BUSDATA_ITEM where rownum < 1
Build TableMeta ...
Skip table :CWXX
Skip table :GXJX_ZYXXSJLB
Skip table :GXXS_XJJBSJZLB
Skip table :GXXS_XSJBSJZL
Skip table :GXXS_ZSZLB
Skip table :GXXX_BJSJLB
Skip table :GXXX_YXSDWJBSJZL
Skip table :QSXX
2019-03-15 10:55:59:017 DEBUG [druid.sql.Statement] {conn-10001, stmt-20003} executed. select * from FNE_COLLEGES_BILL_INFO where rownum < 1
2019-03-15 10:55:59:024 DEBUG [druid.sql.Statement] {conn-10001, stmt-20004} executed. select * from FNE_COLLEGES_BUSDATA where rownum < 1
2019-03-15 10:55:59:030 DEBUG [druid.sql.Statement] {conn-10001, stmt-20005} executed. select * from FNE_COLLEGES_BUSDATA_ITEM where rownum < 1
Generate base model ...
Base Model Output Dir: D:\workspace\axinfu\tyfp_bs/src/main/java/com/axinfu/tyfp_bs/model
Generate model ...
Model Output Dir: D:\workspace\axinfu\tyfp_bs/src/main/java/com/axinfu/tyfp_bs/dao
Generate MappingKit file ...
MappingKit Output Dir: D:\workspace\axinfu\tyfp_bs/src/main/java/com/axinfu/tyfp_bs
Generate DataDictionary file ...
Data Dictionary Output Dir: D:\workspace\axinfu\tyfp_bs/src/main/java/com/axinfu/tyfp_bs/dao
Exception in thread "main" java.lang.RuntimeException: java.sql.SQLException: 流已被关闭
at com.jfinal.plugin.activerecord.generator.DataDictionaryGenerator.rebuildColumnMetas(DataDictionaryGenerator.java:214)
at com.jfinal.plugin.activerecord.generator.DataDictionaryGenerator.generate(DataDictionaryGenerator.java:70)
at com.jfinal.plugin.activerecord.generator.Generator.generate(Generator.java:289)
at com.axinfu.tyfp_bs.gen.GenModel.main(GenModel.java:57)
Caused by: java.sql.SQLException: 流已被关闭
at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:199)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:263)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:271)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:445)
at oracle.jdbc.driver.LongAccessor.getBytesInternal(LongAccessor.java:154)
at oracle.jdbc.driver.LongAccessor.getBytes(LongAccessor.java:126)
at oracle.jdbc.driver.LongAccessor.getString(LongAccessor.java:193)
at oracle.jdbc.driver.T4CLongAccessor.getString(T4CLongAccessor.java:417)
at oracle.jdbc.driver.OracleResultSetImpl.getString(OracleResultSetImpl.java:971)
at oracle.jdbc.driver.OracleResultSet.getString(OracleResultSet.java:494)
at com.jfinal.plugin.activerecord.generator.DataDictionaryGenerator.rebuildColumnMetas(DataDictionaryGenerator.java:188)
... 3 more
Disconnected from the target VM, address: '127.0.0.1:8725', transport: 'socket'
Process finished with exit code 1
DataSource dataSource = DbKit.getConfig().getDataSource();
String basePath = System.getProperty("user.dir") + "/src/main/java/com/axinfu/tyfp_bs";
String basePkg = "com.axinfu.tyfp_bs";
String baseModelPackageName = basePkg + ".model";
String baseModelOutputDir = basePath + "/model";
String modelPackageName = basePkg + ".dao";
String modelOutputDir = basePath + "/dao";
String mappingPackageName = basePkg;
String mappingOutputDir = basePath;
BaseModelGenerator myBaseModelGenerator = new BaseModelGenerator(baseModelPackageName, baseModelOutputDir);
myBaseModelGenerator.setTemplate("gen/model.e");
ModelGenerator modelGenerator = new ModelGenerator(modelPackageName, baseModelPackageName, modelOutputDir);
modelGenerator.setTemplate("gen/dao.e");
MappingKitGenerator mappingKitGenerator = new MappingKitGenerator(mappingPackageName, mappingOutputDir);
mappingKitGenerator.setTemplate("gen/mapping_kit.e");
mappingKitGenerator.setMappingKitClassName("_MappingKit");
Generator gernerator = new Generator(dataSource, myBaseModelGenerator, modelGenerator);
gernerator.setMappingKitGenerator(mappingKitGenerator);
gernerator.setMetaBuilder(new MetaBuilder(dataSource) {
@Override
protected boolean isSkipTable(String tableName) {
return !tableName.startsWith("FNE_");
}
});
gernerator.setDialect(new OracleDialect());
gernerator.setGenerateDaoInModel(true);
gernerator.setGenerateDataDictionary(true);
//gernerator.setRemovedTableNamePrefixes("t_");
gernerator.generate();