Class SqlJetTableDef
- java.lang.Object
-
- org.tmatesoft.sqljet.core.internal.schema.SqlJetTableDef
-
- All Implemented Interfaces:
ISqlJetTableDef
public class SqlJetTableDef extends java.lang.Object implements ISqlJetTableDef
-
-
Constructor Summary
Constructors Constructor Description SqlJetTableDef(org.antlr.runtime.tree.CommonTree ast, int page)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ISqlJetColumnDefgetColumn(java.lang.String name)Returns column definition with a given name or null if there is no such definition.SqlJetColumnIndexConstraintgetColumnIndexConstraint(java.lang.String indexName)intgetColumnNumber(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.StringgetDatabaseName()java.lang.StringgetName()Returns table name.java.util.List<ISqlJetColumnDef>getNotNullColumns()intgetPage()java.util.List<java.lang.String>getPrimaryKeyColumnNames()java.lang.StringgetPrimaryKeyIndexName()Returns name of the primary key index.java.lang.StringgetQuotedName()longgetRowId()intgetRowIdPrimaryKeyColumnIndex()java.lang.StringgetRowIdPrimaryKeyColumnName()SqlJetTableIndexConstraintgetTableIndexConstraint(java.lang.String indexName)booleanisAutoincremented()Returns true if primary key has 'autoincrement' keyword.booleanisKeepExisting()booleanisRowIdPrimaryKey()Returns true if primary key definition allows rowid to be used as primary key column.booleanisTemporary()True if table was created temporarily.voidsetPage(int page)voidsetRowId(long rowId)java.lang.StringtoSQL()java.lang.StringtoSQL(boolean schemaStrict)java.lang.StringtoString()
-
-
-
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:ISqlJetTableDefReturns table name.- Specified by:
getNamein interfaceISqlJetTableDef
-
getQuotedName
public java.lang.String getQuotedName()
- Specified by:
getQuotedNamein interfaceISqlJetTableDef
-
getDatabaseName
public java.lang.String getDatabaseName()
-
isTemporary
public boolean isTemporary()
Description copied from interface:ISqlJetTableDefTrue if table was created temporarily.- Specified by:
isTemporaryin interfaceISqlJetTableDef
-
isKeepExisting
public boolean isKeepExisting()
-
getColumns
public java.util.List<ISqlJetColumnDef> getColumns()
Description copied from interface:ISqlJetTableDefDefinitions of table columns.- Specified by:
getColumnsin interfaceISqlJetTableDef
-
getColumn
public ISqlJetColumnDef getColumn(java.lang.String name)
Description copied from interface:ISqlJetTableDefReturns column definition with a given name or null if there is no such definition.- Specified by:
getColumnin interfaceISqlJetTableDef
-
getColumnNumber
public int getColumnNumber(java.lang.String name)
Description copied from interface:ISqlJetTableDefReturns position of the specified column within the table definition.- Specified by:
getColumnNumberin interfaceISqlJetTableDef
-
getConstraints
public java.util.List<ISqlJetTableConstraint> getConstraints()
Description copied from interface:ISqlJetTableDefReturns all table constraints.- Specified by:
getConstraintsin interfaceISqlJetTableDef
-
isRowIdPrimaryKey
public boolean isRowIdPrimaryKey()
Description copied from interface:ISqlJetTableDefReturns 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:
isRowIdPrimaryKeyin interfaceISqlJetTableDef
-
isAutoincremented
public boolean isAutoincremented()
Description copied from interface:ISqlJetTableDefReturns true if primary key has 'autoincrement' keyword.- Specified by:
isAutoincrementedin interfaceISqlJetTableDef
-
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:
getPrimaryKeyIndexNamein interfaceISqlJetTableDef- 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:
toStringin classjava.lang.Object
-
toSQL
public java.lang.String toSQL()
- Specified by:
toSQLin interfaceISqlJetTableDef- Returns:
- SQL representation of this table schema definition.
-
toSQL
public java.lang.String toSQL(boolean schemaStrict)
-
-