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

wiki.xsx.jg.core.Entity 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 and sqlserver.

The newest version!
package wiki.xsx.jg.core;

import java.util.*;

/**
 * 实体类对象,可看作数据库中对应的表或数据表对应的Java类
 */
public class Entity {
    // 名称
    private String name;
    // 字段对象集合
    private Map fieldMap = new LinkedHashMap<>();
    // 注释
    private String comment;

    public Entity(String name, String comment) {
        this.name = name;
        this.comment = comment;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Map getFieldMap() {
        return fieldMap;
    }

    public Set getColumnSet() {
        return new LinkedHashSet<>(fieldMap.values());
    }

    public Field getColumn(String columnName) {
        return fieldMap.get(columnName);
    }

    public void setFieldMap(Map fieldMap) {
        this.fieldMap = fieldMap;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    @Override
    public String toString() {
        return "Entity{" +
                "name='" + name + '\'' +
                ", fieldMap=" + fieldMap +
                ", comment='" + comment + '\'' +
                '}';
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy