package com.quantum.model;

import java.sql.SQLException;

/**
 * @author BC
 */
public interface Entity extends BookmarkHolder, Comparable {
    
    public static final String TABLE_TYPE = "TABLE";
    public static final String VIEW_TYPE = "VIEW";
    public static final String SEQUENCE_TYPE = "SEQUENCE";
    
    public String getName();
    public String getSchema();
    public String getType();
	public boolean isSynonym();
	
    public Column[] getColumns() throws NotConnectedException, SQLException;
    public Index[] getIndexes() throws NotConnectedException, SQLException;
    public Column getColumn(String columnName) throws NotConnectedException, SQLException;
    /**
     * Returns a String with the qualified name of the Entity in the
     * format "schema.name". 
	 */
	public String getQualifiedName();
    
    /**
     * @return - TRUE if the entity exists in the database<br />
     *         - FALSE if the entity does not exist in the database<br />
     *         - null if it's not known whether or not the 
     *           entity exists in the database.
     */
    public Boolean exists();
    /**
     * Some databases support mixed-case table names.  Queries issued
     * against these tables must be quoted.
     * @return
     */
    public String getQuotedTableName();
    public ForeignKey[] getExportedKeys() throws NotConnectedException, SQLException;
    public ForeignKey[] getImportedKeys() throws NotConnectedException, SQLException;
    public ForeignKey[] getReferences() throws NotConnectedException, SQLException;
}