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

org.smyld.db.schema.ForeignKey Maven / Gradle / Ivy

There is a newer version: 1.0.9
Show newest version
package org.smyld.db.schema;

import org.smyld.text.TextUtil;

public class ForeignKey extends PrimaryKey {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	PrimaryKey primaryKey;
	String table;

	public ForeignKey() {
		setSchemaType(TAG_NAME_F_KEY);
	}

	public PrimaryKey getPrimaryKey() {
		return primaryKey;
	}

	public void setPrimaryKey(PrimaryKey primaryKey) {
		this.primaryKey = primaryKey;
	}

	public String getTable() {
		return table;
	}

	public void setTable(String table) {
		this.table = table;
	}

	@Override
	public boolean equals(Object compare) {
		if (compare instanceof ForeignKey) {
			ForeignKey comp = (ForeignKey) compare;
			if (TextUtil.compare(name, comp.getName()))
				if (TextUtil.compare(table, comp.getTable()))
					if (TextUtil.compare(columnName, comp.getColumnName()))
						return (TextUtil.compare(primaryKey.getColumnName(),
								comp.getPrimaryKey().getColumnName()));
		}
		return false;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy