preparing new release
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.quantum.sql / src / com / quantum / model / Entity.java
1 package com.quantum.model;
2
3 import java.sql.SQLException;
4
5 /**
6  * @author BC
7  */
8 public interface Entity extends BookmarkHolder, Comparable {
9     
10     public static final String TABLE_TYPE = "TABLE";
11     public static final String VIEW_TYPE = "VIEW";
12     public static final String SEQUENCE_TYPE = "SEQUENCE";
13     
14     public String getName();
15     public String getSchema();
16     public String getType();
17         public boolean isSynonym();
18         
19     public Column[] getColumns() throws NotConnectedException, SQLException;
20     public Index[] getIndexes() throws NotConnectedException, SQLException;
21     public Column getColumn(String columnName) throws NotConnectedException, SQLException;
22     /**
23      * Returns a String with the qualified name of the Entity in the
24      * format "schema.name". 
25          */
26         public String getQualifiedName();
27     
28     /**
29      * @return - TRUE if the entity exists in the database<br />
30      *         - FALSE if the entity does not exist in the database<br />
31      *         - null if it's not known whether or not the 
32      *           entity exists in the database.
33      */
34     public Boolean exists();
35     /**
36      * Some databases support mixed-case table names.  Queries issued
37      * against these tables must be quoted.
38      * @return
39      */
40     public String getQuotedTableName();
41     public ForeignKey[] getExportedKeys() throws NotConnectedException, SQLException;
42     public ForeignKey[] getImportedKeys() throws NotConnectedException, SQLException;
43     public ForeignKey[] getReferences() throws NotConnectedException, SQLException;
44 }