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

liquibase.structure.core.Table Maven / Gradle / Ivy

There is a newer version: 4.30.0
Show newest version
package liquibase.structure.core;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class Table extends Relation {


    public Table() {
        setAttribute("outgoingForeignKeys", new ArrayList());
        setAttribute("indexes", new ArrayList());
        setAttribute("uniqueConstraints", new ArrayList());
    }

    public PrimaryKey getPrimaryKey() {
        return getAttribute("primaryKey", PrimaryKey.class);
    }

    public void setPrimaryKey(PrimaryKey primaryKey) {
        this.setAttribute("primaryKey", primaryKey);
    }

    public List getOutgoingForeignKeys() {
        return getAttribute("outgoingForeignKeys", List.class);
    }

    public List getIndexes() {
        return getAttribute("indexes", List.class);
    }

    public List getUniqueConstraints() {
        return getAttribute("uniqueConstraints", List.class);
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Table that = (Table) o;

        return getName().equalsIgnoreCase(that.getName());

    }

    @Override
    public int hashCode() {
        return getName().toUpperCase().hashCode();
    }

    @Override
    public String toString() {
        return getName();
    }

    @Override
    public Table setName(String name) {
        return (Table) super.setName(name);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy