All Downloads are FREE. Search and download functionalities are using the official Maven repository.

wiki.xsx.jg.core.Table Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 1.2.1
Show newest version
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 + '\'' +
                '}';
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy