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

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

public class SqlJetTableDef
extends java.lang.Object
implements ISqlJetTableDef


Constructor Summary
SqlJetTableDef(org.antlr.runtime.tree.CommonTree ast, int page)
           
 
Method Summary
 ISqlJetColumnDef getColumn(java.lang.String name)
          Returns column definition with a given name or null if there is no such definition.
 SqlJetColumnIndexConstraint getColumnIndexConstraint(java.lang.String indexName)
           
 int getColumnNumber(java.lang.String name)
          Returns position of the specified column within the table definition.
 java.util.List<ISqlJetColumnDef> getColumns()
          Definitions of table columns.
 java.util.List<ISqlJetTableConstraint> getConstraints()
          Returns all table constraints.
 java.lang.String getDatabaseName()
           
 java.lang.String getName()
          Returns table name.
 java.util.List<ISqlJetColumnDef> getNotNullColumns()
           
 int getPage()
           
 java.util.List<java.lang.String> getPrimaryKeyColumnNames()
           
 java.lang.String getPrimaryKeyIndexName()
          Returns name of the primary key index.
 long getRowId()
           
 int getRowIdPrimaryKeyColumnIndex()
           
 java.lang.String getRowIdPrimaryKeyColumnName()
           
 SqlJetTableIndexConstraint getTableIndexConstraint(java.lang.String indexName)
           
 boolean isAutoincremented()
          Returns true if primary key has 'autoincrement' keyword.
 boolean isKeepExisting()
           
 boolean isRowIdPrimaryKey()
          Returns true if primary key definition allows rowid to be used as primary key column.
 boolean isTemporary()
          True if table was created temporarily.
 void setPage(int page)
           
 void setRowId(long rowId)
           
 java.lang.String toSQL()
           
 java.lang.String toSQL(boolean schemaStrict)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SqlJetTableDef

public SqlJetTableDef(org.antlr.runtime.tree.CommonTree ast,
                      int page)
               throws SqlJetException
Throws:
SqlJetException
Method Detail

getName

public java.lang.String getName()
Description copied from interface: ISqlJetTableDef
Returns table name.

Specified by:
getName in interface ISqlJetTableDef

getDatabaseName

public java.lang.String getDatabaseName()

isTemporary

public boolean isTemporary()
Description copied from interface: ISqlJetTableDef
True if table was created temporarily.

Specified by:
isTemporary in interface ISqlJetTableDef

isKeepExisting

public boolean isKeepExisting()

getColumns

public java.util.List<ISqlJetColumnDef> getColumns()
Description copied from interface: ISqlJetTableDef
Definitions of table columns.

Specified by:
getColumns in interface ISqlJetTableDef

getColumn

public ISqlJetColumnDef getColumn(java.lang.String name)
Description copied from interface: ISqlJetTableDef
Returns column definition with a given name or null if there is no such definition.

Specified by:
getColumn in interface ISqlJetTableDef

getColumnNumber

public int getColumnNumber(java.lang.String name)
Description copied from interface: ISqlJetTableDef
Returns position of the specified column within the table definition.

Specified by:
getColumnNumber in interface ISqlJetTableDef

getConstraints

public java.util.List<ISqlJetTableConstraint> getConstraints()
Description copied from interface: ISqlJetTableDef
Returns all table constraints.

Specified by:
getConstraints in interface ISqlJetTableDef

isRowIdPrimaryKey

public boolean isRowIdPrimaryKey()
Description copied from interface: ISqlJetTableDef
Returns true if primary key definition allows rowid to be used as primary key column. In practice this means that the table has primary key that is based in a single column of type 'integer'.

Specified by:
isRowIdPrimaryKey in interface ISqlJetTableDef

isAutoincremented

public boolean isAutoincremented()
Description copied from interface: ISqlJetTableDef
Returns true if primary key has 'autoincrement' keyword.

Specified by:
isAutoincremented in interface ISqlJetTableDef

getPage

public int getPage()

setPage

public void setPage(int page)

getRowId

public long getRowId()

setRowId

public void setRowId(long rowId)

getPrimaryKeyIndexName

public java.lang.String getPrimaryKeyIndexName()
Returns name of the primary key index.

Specified by:
getPrimaryKeyIndexName in interface ISqlJetTableDef
Returns:
name of the primary key index.

getRowIdPrimaryKeyColumnName

public java.lang.String getRowIdPrimaryKeyColumnName()

getRowIdPrimaryKeyColumnIndex

public int getRowIdPrimaryKeyColumnIndex()

getPrimaryKeyColumnNames

public java.util.List<java.lang.String> getPrimaryKeyColumnNames()

getColumnIndexConstraint

public SqlJetColumnIndexConstraint getColumnIndexConstraint(java.lang.String indexName)

getTableIndexConstraint

public SqlJetTableIndexConstraint getTableIndexConstraint(java.lang.String indexName)

getNotNullColumns

public java.util.List<ISqlJetColumnDef> getNotNullColumns()
Returns:
the notNullColumnsCache

toString

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

toSQL

public java.lang.String toSQL()
Specified by:
toSQL in interface ISqlJetTableDef
Returns:
SQL representation of this table schema definition.

toSQL

public java.lang.String toSQL(boolean schemaStrict)