package hiro.yoshioka.sdh;

import hiro.yoshioka.util.SQLDataType;

public class RDHMetaColumn {
	private SQLDataType type = SQLDataType.UNKNOWN;
	private String name;
	private int index;
	private Boolean notNull;
	private Boolean pk;

	public RDHMetaColumn(String name, int index) {
		this.name = name;
		this.index = index;
	}

	public void setNotNull(Boolean notNull) {
		this.notNull = notNull;
	}

	public Boolean getNotNull() {
		return notNull;
	}

	public void setPk(Boolean pk) {
		this.pk = pk;
	}

	public boolean isPercent() {
		return getName().indexOf('%') >= 0;
	}

	public Boolean getPk() {
		return pk;
	}

	public void setType(SQLDataType type) {
		this.type = type;
	}

	public int getIndex() {
		return index;
	}

	public String getName() {
		return name;
	}

	public SQLDataType getType() {
		return type;
	}
}
