public class TableWorks
extends java.lang.Object
Title: Dataspace Framework
Description: Dataspace underlying provider implementation
Copyright: Copyright (c) 2010
Company: StreamScape Technologies
Constructor and Description |
---|
TableWorks(com.streamscape.ds.session.Session session,
Table table) |
Modifier and Type | Method and Description |
---|---|
void |
addCheckConstraint(Constraint c) |
void |
addColumn(ColumnSchema column,
int colIndex,
com.streamscape.ds.lib.HsqlArrayList constraints) |
void |
addForeignKey(Constraint c)
Creates a foreign key on an existing table.
|
com.streamscape.ds.persist.index.Index |
addIndex(int[] col,
NameManager.ObjectName name,
boolean unique,
SIndexType sIndexType)
Because of the way indexes and column data are held in memory and on
disk, it is necessary to recreate the table when an index is added to a
non-empty cached table.
|
Table |
addPrimaryKey(Constraint constraint) |
void |
addUniqueConstraint(Constraint constraint) |
void |
alterIndex(com.streamscape.ds.persist.index.Index index,
int[] cols) |
void |
checkCreateForeignKey(Constraint c) |
void |
dropColumn(int colIndex,
boolean cascade) |
void |
dropConstraint(java.lang.String name,
boolean cascade) |
void |
dropIndex(java.lang.String indexName)
Because of the way indexes and column data are held in memory and on
disk, it is necessary to recreate the table when an index is added to or
removed from a non-empty table.
|
Table |
getTable() |
com.streamscape.ds.lib.OrderedHashSet |
makeNewTables(com.streamscape.ds.lib.OrderedHashSet tableSet,
com.streamscape.ds.lib.OrderedHashSet dropConstraintSet,
com.streamscape.ds.lib.OrderedHashSet dropIndexSet) |
void |
retypeColumn(ColumnSchema oldCol,
ColumnSchema newCol)
Allows changing the type only.
|
void |
setColDefaultExpression(int colIndex,
com.streamscape.ds.parser.expression.Expression def)
performs the work for changing the default value of a column
|
void |
setColNullability(ColumnSchema column,
boolean nullable)
performs the work for changing the nullability of a column
|
void |
setNewTablesInSchema(com.streamscape.ds.lib.OrderedHashSet tableSet) |
boolean |
setTableType(com.streamscape.ds.session.Session session,
int newType)
Changes the type of a table
|
void |
updateConstraints(com.streamscape.ds.lib.OrderedHashSet tableSet,
com.streamscape.ds.lib.OrderedHashSet dropConstraints) |
public TableWorks(com.streamscape.ds.session.Session session, Table table)
public Table getTable()
public void checkCreateForeignKey(Constraint c)
public void addForeignKey(Constraint c)
Since version 1.7.2, a unique constraint on the referenced columns must exist. The non-unique index on the referencing table is now always created whether or not a PK or unique constraint index on the columns exist. Foriegn keys on temp tables can reference other temp tables with the same rules above. Foreign keys on permanent tables cannot reference temp tables. Duplicate foreign keys are now disallowed.
c
- the constraint objectpublic void addColumn(ColumnSchema column, int colIndex, com.streamscape.ds.lib.HsqlArrayList constraints)
public void updateConstraints(com.streamscape.ds.lib.OrderedHashSet tableSet, com.streamscape.ds.lib.OrderedHashSet dropConstraints)
public com.streamscape.ds.lib.OrderedHashSet makeNewTables(com.streamscape.ds.lib.OrderedHashSet tableSet, com.streamscape.ds.lib.OrderedHashSet dropConstraintSet, com.streamscape.ds.lib.OrderedHashSet dropIndexSet)
public void alterIndex(com.streamscape.ds.persist.index.Index index, int[] cols)
public com.streamscape.ds.persist.index.Index addIndex(int[] col, NameManager.ObjectName name, boolean unique, SIndexType sIndexType)
With empty tables, Index objects are simply added
With MEOMRY and TEXT tables, a new index is built up and nodes for earch row are interlinked (fredt@users)
col
- int[]name
- HsqlNameunique
- booleanpublic Table addPrimaryKey(Constraint constraint)
public void addUniqueConstraint(Constraint constraint)
public void addCheckConstraint(Constraint c)
public void dropIndex(java.lang.String indexName)
Originally, this method would break existing foreign keys as the table order in the DB was changed. The new table is now linked in place of the old table (fredt@users)
indexName
- Stringpublic void dropColumn(int colIndex, boolean cascade)
public void dropConstraint(java.lang.String name, boolean cascade)
public void retypeColumn(ColumnSchema oldCol, ColumnSchema newCol)
oldCol
- ColumnnewCol
- Columnpublic void setColNullability(ColumnSchema column, boolean nullable)
column
- Columnnullable
- booleanpublic void setColDefaultExpression(int colIndex, com.streamscape.ds.parser.expression.Expression def)
colIndex
- intdef
- Expressionpublic boolean setTableType(com.streamscape.ds.session.Session session, int newType)
session
- SessionnewType
- intpublic void setNewTablesInSchema(com.streamscape.ds.lib.OrderedHashSet tableSet)
Copyright © 2015-2024 StreamScape Technologies. All rights reserved.