资源简介

codegenerate-3.6.1.jar的源码,下载了最新jd-gui工具反编译的。jeecg框架是最新的3.7,最近做二次开发需要修改自动生成代码。做jeecg二次开发的可以相互探讨交流

资源截图

代码片段和文件信息

package org.jeecgframework.codegenerate.database;

import java.io.PrintStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jeecgframework.codegenerate.pojo.Columnt;
import org.jeecgframework.codegenerate.pojo.TableConvert;
import org.jeecgframework.codegenerate.util.CodeResourceUtil;
import org.jeecgframework.codegenerate.util.CodeStringUtils;

public class JeecgReadTable {
private static final Log log = LogFactory.getLog((Class) JeecgReadTable.class);
private static final long serialVersionUID = -5324160085184088010L;
private Connection conn;
private Statement stmt;
private String sql;
private ResultSet rs;

public static void main(String[] args) throws SQLException {
try {
List cls = new JeecgReadTable().readTableColumn(“person“);
for (Columnt c : cls) {
System.out.println(c.getFieldName());
}
} catch (Exception e) {
e.printStackTrace();
}
System.out.println(ArrayUtils.toString(new JeecgReadTable().readAllTableNames()));
}

public List readAllTableNames() throws SQLException {
ArrayList tableNames;
tableNames = new ArrayList(0);
try {
try {
Class.forName(CodeResourceUtil.DIVER_NAME);
this.conn = DriverManager.getConnection(CodeResourceUtil.URL CodeResourceUtil.USERNAME
CodeResourceUtil.PASSWORD);
this.stmt = this.conn.createStatement(1005 1007);
if (CodeResourceUtil.DATAbase_TYPE.equals(“mysql“)) {
this.sql = MessageFormat.format(
“select distinct table_name from information_schema.columns where table_schema = {0}“
TableConvert.getV((String) CodeResourceUtil.DATAbase_NAME));
}
if (CodeResourceUtil.DATAbase_TYPE.equals(“oracle“)) {
this.sql = “ select distinct colstable.table_name as  table_name from user_tab_cols colstable“;
}
if (CodeResourceUtil.DATAbase_TYPE.equals(“postgresql“)) {
this.sql = “SELECT distinct c.relname AS  table_name FROM pg_class c“;
}
if (CodeResourceUtil.DATAbase_TYPE.equals(“sqlserver“)) {
this.sql = “select distinct c.name as  table_name from sys.objects c “;
}
this.rs = this.stmt.executeQuery(this.sql);
while (this.rs.next()) {
String tableName = this.rs.getString(1);
tableNames.add(tableName);
}
} catch (Exception e) {
e.printStackTrace();
if (this.stmt != null) {
this.stmt.close();
this.stmt = null;
System.gc();
}
if (this.conn != null) {
this.conn.close();
this.conn = null;
System.gc();
}
}
} finally {
if (this.stmt != null) {
this

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-06-28 14:09  codegenerate-3.6.1\
     目录           0  2017-06-28 14:04  codegenerate-3.6.1\org\
     目录           0  2017-06-28 14:06  codegenerate-3.6.1\org\jeecgframework\
     目录           0  2017-06-28 14:06  codegenerate-3.6.1\org\jeecgframework\codegenerate\
     目录           0  2017-06-28 14:06  codegenerate-3.6.1\org\jeecgframework\codegenerate\database\
     文件       20970  2017-06-27 17:03  codegenerate-3.6.1\org\jeecgframework\codegenerate\database\JeecgReadTable.java
     目录           0  2017-06-28 14:07  codegenerate-3.6.1\org\jeecgframework\codegenerate\generate\
     文件        6552  2017-06-27 16:57  codegenerate-3.6.1\org\jeecgframework\codegenerate\generate\baseCodeFactory.java
     文件        5575  2017-06-27 16:49  codegenerate-3.6.1\org\jeecgframework\codegenerate\generate\CgformCodeFactory.java
     文件       12441  2017-06-27 16:58  codegenerate-3.6.1\org\jeecgframework\codegenerate\generate\CgformCodeGenerate.java
     文件        4411  2017-06-27 16:58  codegenerate-3.6.1\org\jeecgframework\codegenerate\generate\CodeFactory.java
     文件        7356  2017-06-27 16:49  codegenerate-3.6.1\org\jeecgframework\codegenerate\generate\CodeGenerate.java
     文件         267  2017-06-27 16:49  codegenerate-3.6.1\org\jeecgframework\codegenerate\generate\ICallBack.java
     目录           0  2017-06-28 14:07  codegenerate-3.6.1\org\jeecgframework\codegenerate\generate\onetomany\
     文件        4288  2017-06-27 17:03  codegenerate-3.6.1\org\jeecgframework\codegenerate\generate\onetomany\CgformCodeFactoryOneToMany.java
     文件       16907  2017-06-27 17:03  codegenerate-3.6.1\org\jeecgframework\codegenerate\generate\onetomany\CgformCodeGenerateOneToMany.java
     文件        4649  2017-06-27 16:56  codegenerate-3.6.1\org\jeecgframework\codegenerate\generate\onetomany\CodeFactoryOneToMany.java
     文件       11326  2017-06-27 16:40  codegenerate-3.6.1\org\jeecgframework\codegenerate\generate\onetomany\CodeGenerateOneToMany.java
     目录           0  2017-06-28 14:08  codegenerate-3.6.1\org\jeecgframework\codegenerate\pojo\
     文件        2605  2017-06-27 16:50  codegenerate-3.6.1\org\jeecgframework\codegenerate\pojo\Columnt.java
     文件        1496  2017-06-27 16:50  codegenerate-3.6.1\org\jeecgframework\codegenerate\pojo\CreateFileProperty.java
     目录           0  2017-06-28 14:07  codegenerate-3.6.1\org\jeecgframework\codegenerate\pojo\onetomany\
     文件        1910  2017-06-27 16:49  codegenerate-3.6.1\org\jeecgframework\codegenerate\pojo\onetomany\CodeParamEntity.java
     文件        1886  2017-06-27 16:49  codegenerate-3.6.1\org\jeecgframework\codegenerate\pojo\onetomany\SubTableEntity.java
     文件         852  2017-06-27 16:50  codegenerate-3.6.1\org\jeecgframework\codegenerate\pojo\TableConvert.java
     目录           0  2017-06-28 14:08  codegenerate-3.6.1\org\jeecgframework\codegenerate\util\
     文件       16878  2017-06-27 16:50  codegenerate-3.6.1\org\jeecgframework\codegenerate\util\CodeDateUtils.java
     文件        6185  2017-06-27 16:50  codegenerate-3.6.1\org\jeecgframework\codegenerate\util\CodeResourceUtil.java
     文件        1753  2017-06-27 16:51  codegenerate-3.6.1\org\jeecgframework\codegenerate\util\CodeStringUtils.java
     目录           0  2017-06-28 14:08  codegenerate-3.6.1\org\jeecgframework\codegenerate\util\def\
     文件        2885  2017-06-27 16:50  codegenerate-3.6.1\org\jeecgframework\codegenerate\util\def\ConvertDef.java
............此处省略11个文件信息

评论

共有 条评论