wiki.xsx.jg.core.Table Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of JG-All Show documentation
Show all versions of JG-All Show documentation
a generator, from the database tables convert to the Java classes or from the Java classes convert to the database tables.
support mysql, oracle, sqlserver and postgresql.
package wiki.xsx.jg.core;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
/**
* 数据库中的表对象
*/
public class Table {
// 表名称
private String name;
// 表中的列集合
private Map columnMap = new HashMap<>();
// 表的注释
private String remark;
public Table(String name, String remark) {
this.name = name;
this.remark = remark;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Map getColumnMap() {
return columnMap;
}
public Set getColumnSet() {
return new HashSet<>(columnMap.values());
}
public Column getColumn(String columnName) {
return columnMap.get(columnName);
}
public void setColumnMap(Map columnMap) {
this.columnMap = columnMap;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
@Override
public String toString() {
return "Table{" +
"name='" + name + '\'' +
", columnMap=" + columnMap +
", remark='" + remark + '\'' +
'}';
}
}