Class Table
java.lang.Object
com.inductiveautomation.ignition.gateway.localdb.Table
- Direct Known Subclasses:
- HsqlTable,- SQLiteTable
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionclassclassclass
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected List<Table.Column>protected List<Table.ForeignKey>protected StringThe name of the tableprotected Table.PrimaryKey
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbuildFor(String tableName, DataSource db) buildFor(SRecordMeta<? extends SRecordInstance> meta) booleancanAlterFrom(Table existingTable) Returns true if all of the modifications required can be handled through altering.colQC()findColumn(String name) findSequences(String tableName, Connection conn) protected StringgetColumnDdl(Table.Column col) protected StringgetColumnTypeSql(SFieldScalar field) getIndexName(Table.Column column) getPhase1AlterDdl(Table existing) Does all alter column statementsgetPhase1Transfer(Table originalTable) getPhase2AlterDdl(Table existing) Does all constraint and sequence modificationgetPhase2Transfer(Table originalTable) getTransferCommand(Table originalTable, String sourceName) qc()protected voidsqlDefinition_CreateForeignKeys(List<String> commands, List<Table.ForeignKey> fks) Should create the sql for adding the foreign keys and add them to the "commands" listprotected StringsqlDefinition_CreateIndex(String indexName, String tableName, String columnName) protected StringsqlDefinition_CreateSequence(String sequence, String table) Returns the full "CREATE SEQUENCE seqName"protected StringsqlDefinition_DropIndex(String indexName) protected StringReturns the keyword(s) to use for create TABLE.protected booleanprotected booleanbooleanprotected StringvalueToQueryLiteral(Object value, String columnType) protected StringvalueToQueryLiteral(Object value, SFieldScalar field) In some cases, we put the value of the column directly into the query.
- 
Field Details- 
nameThe name of the table
- 
columns
- 
pk
- 
fks
- 
sequences
 
- 
- 
Constructor Details- 
Tablepublic Table()
 
- 
- 
Method Details- 
tableExistspublic boolean tableExists()
- 
buildFor
- 
buildFor
- 
buildFor- Throws:
- SQLException
 
- 
buildNew
- 
colQC
- 
qc
- 
canAlterFromReturns true if all of the modifications required can be handled through altering. If not, a new version of the table will be made.
- 
supportsConstraintModificationprotected boolean supportsConstraintModification()
- 
getTransferCommand
- 
findSequencesprotected abstract List<String> findSequences(String tableName, Connection conn) throws SQLException - Throws:
- SQLException
 
- 
findColumn
- 
getTableName
- 
getPhase1AlterDdlDoes all alter column statements
- 
getPhase2AlterDdlDoes all constraint and sequence modification
- 
sqlDefinition_TableReturns the keyword(s) to use for create TABLE. Default is "TABLE", but HSQL would use "CACHED TABLE"
- 
sqlDefinition_CreateSequenceReturns the full "CREATE SEQUENCE seqName"
- 
sqlDefinition_CreateIndex
- 
sqlDefinition_DropIndex
- 
supportsDropColumnprotected boolean supportsDropColumn()
- 
getColumns
- 
getPrimaryKey
- 
getForeignKeys
- 
getColumnDdl
- 
getTableCreateDdl
- 
getIndexName
- 
getConstraintDdl
- 
sqlDefinition_CreateForeignKeysShould create the sql for adding the foreign keys and add them to the "commands" list
- 
getColumnTypeSql
- 
valueToQueryLiteralIn some cases, we put the value of the column directly into the query. This allows us to override how it is represented in the query.
- 
valueToQueryLiteral
- 
getPhase1Transfer
- 
getPhase2Transfer
 
-