org.tmatesoft.sqljet.core.internal.schema
Class SqlJetSchema

java.lang.Object
  extended by org.tmatesoft.sqljet.core.internal.schema.SqlJetSchema
All Implemented Interfaces:
ISqlJetSchema

public class SqlJetSchema
extends java.lang.Object
implements ISqlJetSchema


Field Summary
static java.util.Set<SqlJetBtreeTableCreateFlags> BTREE_CREATE_INDEX_FLAGS
           
static java.util.Set<SqlJetBtreeTableCreateFlags> BTREE_CREATE_TABLE_FLAGS
           
 
Constructor Summary
SqlJetSchema(ISqlJetDbHandle db, ISqlJetBtree btree)
           
 
Method Summary
 ISqlJetTableDef alterTable(java.lang.String sql)
           
 ISqlJetIndexDef createIndex(java.lang.String sql)
           
 ISqlJetIndexDef createIndexForVirtualTable(java.lang.String virtualTableName, java.lang.String indexName)
           
 ISqlJetTableDef createTable(java.lang.String sql)
           
 ISqlJetTriggerDef createTrigger(java.lang.String sql)
           
 ISqlJetViewDef createView(java.lang.String sql)
           
 ISqlJetVirtualTableDef createVirtualTable(java.lang.String sql, int page)
           
 void dropIndex(java.lang.String indexName)
           
 void dropTable(java.lang.String tableName)
           
 void dropTrigger(java.lang.String triggerName)
           
 void dropView(java.lang.String viewName)
           
 ISqlJetBtree getBtree()
           
 ISqlJetDbHandle getDb()
           
 ISqlJetIndexDef getIndex(java.lang.String name)
          Get index definition by name.
 java.util.Set<ISqlJetIndexDef> getIndexes(java.lang.String tableName)
          Get indices related with table.
 java.util.Set<java.lang.String> getIndexNames()
          Get indices names.
 ISqlJetTableDef getTable(java.lang.String name)
          Get table definition by name.
 java.util.Set<java.lang.String> getTableNames()
          Get tables names.
 ISqlJetTriggerDef getTrigger(java.lang.String name)
          Get trigger definition by name.
 java.util.Set<java.lang.String> getTriggerNames()
           
 ISqlJetViewDef getView(java.lang.String name)
          Get view definition by name.
 java.util.Set<java.lang.String> getViewNames()
           
 ISqlJetVirtualTableDef getVirtualTable(java.lang.String name)
           
 java.util.Set<java.lang.String> getVirtualTableNames()
           
 boolean isNameReserved(java.lang.String name)
          Returns true if name is reserved for internal use.
 ISqlJetBtreeDataTable openSequenceTable()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BTREE_CREATE_TABLE_FLAGS

public static final java.util.Set<SqlJetBtreeTableCreateFlags> BTREE_CREATE_TABLE_FLAGS

BTREE_CREATE_INDEX_FLAGS

public static final java.util.Set<SqlJetBtreeTableCreateFlags> BTREE_CREATE_INDEX_FLAGS
Constructor Detail

SqlJetSchema

public SqlJetSchema(ISqlJetDbHandle db,
                    ISqlJetBtree btree)
             throws SqlJetException
Throws:
SqlJetException
Method Detail

getDb

public ISqlJetDbHandle getDb()

getBtree

public ISqlJetBtree getBtree()

getTableNames

public java.util.Set<java.lang.String> getTableNames()
                                              throws SqlJetException
Description copied from interface: ISqlJetSchema
Get tables names.

Specified by:
getTableNames in interface ISqlJetSchema
Returns:
tables names.
Throws:
SqlJetException

getTable

public ISqlJetTableDef getTable(java.lang.String name)
                         throws SqlJetException
Description copied from interface: ISqlJetSchema
Get table definition by name.

Specified by:
getTable in interface ISqlJetSchema
Parameters:
name - table name
Returns:
table definition
Throws:
SqlJetException

getIndexNames

public java.util.Set<java.lang.String> getIndexNames()
                                              throws SqlJetException
Description copied from interface: ISqlJetSchema
Get indices names.

Specified by:
getIndexNames in interface ISqlJetSchema
Returns:
indices names.
Throws:
SqlJetException

getIndex

public ISqlJetIndexDef getIndex(java.lang.String name)
                         throws SqlJetException
Description copied from interface: ISqlJetSchema
Get index definition by name.

Specified by:
getIndex in interface ISqlJetSchema
Parameters:
name - index name
Returns:
index definition
Throws:
SqlJetException

getIndexes

public java.util.Set<ISqlJetIndexDef> getIndexes(java.lang.String tableName)
                                          throws SqlJetException
Description copied from interface: ISqlJetSchema
Get indices related with table.

Specified by:
getIndexes in interface ISqlJetSchema
Parameters:
tableName - table name
Returns:
indices of table
Throws:
SqlJetException

getVirtualTableNames

public java.util.Set<java.lang.String> getVirtualTableNames()
                                                     throws SqlJetException
Specified by:
getVirtualTableNames in interface ISqlJetSchema
Returns:
Set of virtual table names defined in this schema.
Throws:
SqlJetException

getVirtualTable

public ISqlJetVirtualTableDef getVirtualTable(java.lang.String name)
                                       throws SqlJetException
Specified by:
getVirtualTable in interface ISqlJetSchema
Returns:
definition of the virtual table name.
Throws:
SqlJetException

getView

public ISqlJetViewDef getView(java.lang.String name)
                       throws SqlJetException
Description copied from interface: ISqlJetSchema
Get view definition by name.

Specified by:
getView in interface ISqlJetSchema
Parameters:
name - view name
Returns:
view definition
Throws:
SqlJetException

getViewNames

public java.util.Set<java.lang.String> getViewNames()
                                             throws SqlJetException
Specified by:
getViewNames in interface ISqlJetSchema
Returns:
Set of view names defined in this schema.
Throws:
SqlJetException

getTrigger

public ISqlJetTriggerDef getTrigger(java.lang.String name)
                             throws SqlJetException
Description copied from interface: ISqlJetSchema
Get trigger definition by name.

Specified by:
getTrigger in interface ISqlJetSchema
Parameters:
name - trigger name
Returns:
trigger definition
Throws:
SqlJetException

getTriggerNames

public java.util.Set<java.lang.String> getTriggerNames()
                                                throws SqlJetException
Specified by:
getTriggerNames in interface ISqlJetSchema
Returns:
Set of trigger names defined in this schema.
Throws:
SqlJetException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

createTable

public ISqlJetTableDef createTable(java.lang.String sql)
                            throws SqlJetException
Throws:
SqlJetException

openSequenceTable

public ISqlJetBtreeDataTable openSequenceTable()
                                        throws SqlJetException
Throws:
SqlJetException

createIndex

public ISqlJetIndexDef createIndex(java.lang.String sql)
                            throws SqlJetException
Throws:
SqlJetException

dropTable

public void dropTable(java.lang.String tableName)
               throws SqlJetException
Throws:
SqlJetException

dropIndex

public void dropIndex(java.lang.String indexName)
               throws SqlJetException
Throws:
SqlJetException

alterTable

public ISqlJetTableDef alterTable(java.lang.String sql)
                           throws SqlJetException
Throws:
SqlJetException

createVirtualTable

public ISqlJetVirtualTableDef createVirtualTable(java.lang.String sql,
                                                 int page)
                                          throws SqlJetException
Throws:
SqlJetException

createView

public ISqlJetViewDef createView(java.lang.String sql)
                          throws SqlJetException
Throws:
SqlJetException

isNameReserved

public boolean isNameReserved(java.lang.String name)
Returns true if name is reserved for internal use.

Parameters:
name -
Returns:
true if name is reserved

createIndexForVirtualTable

public ISqlJetIndexDef createIndexForVirtualTable(java.lang.String virtualTableName,
                                                  java.lang.String indexName)
                                           throws SqlJetException
Throws:
SqlJetException

dropView

public void dropView(java.lang.String viewName)
              throws SqlJetException
Throws:
SqlJetException

dropTrigger

public void dropTrigger(java.lang.String triggerName)
                 throws SqlJetException
Throws:
SqlJetException

createTrigger

public ISqlJetTriggerDef createTrigger(java.lang.String sql)
                                throws SqlJetException
Throws:
SqlJetException