本文整理汇总了Java中org.hsqldb.lib.ArrayUtil.toAdjustedColumnArray方法的典型用法代码示例。如果您正苦于以下问题:Java ArrayUtil.toAdjustedColumnArray方法的具体用法?Java ArrayUtil.toAdjustedColumnArray怎么用?Java ArrayUtil.toAdjustedColumnArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.hsqldb.lib.ArrayUtil
的用法示例。
在下文中一共展示了ArrayUtil.toAdjustedColumnArray方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createAdjustedIndex
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
/**
* Create new index taking into account removal or addition of a column
* to the table.
*/
private Index createAdjustedIndex(Index index, int colindex,
int adjust) throws HsqlException {
int[] indexcolumns = (int[]) ArrayUtil.resizeArray(index.getColumns(),
index.getVisibleColumns());
int[] colarr = ArrayUtil.toAdjustedColumnArray(indexcolumns,
colindex, adjust);
// if a column to remove is one of the Index columns
if (colarr.length != index.getVisibleColumns()) {
return null;
}
return createIndexStructure(colarr, index.getName(), false,
index.isUnique(), index.isConstraint,
index.isForward);
}
示例2: createAdjustedIndex
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
/**
* Create new index taking into account removal or addition of a column
* to the table.
*/
private Index createAdjustedIndex(Index index, int colindex,
int adjust) throws HsqlException {
int[] indexcolumns = (int[]) ArrayUtil.resizeArray(index.getColumns(),
index.getVisibleColumns());
int[] colarr = ArrayUtil.toAdjustedColumnArray(indexcolumns, colindex,
adjust);
// if a column to remove is one of the Index columns
if (colarr.length != index.getVisibleColumns()) {
return null;
}
return createIndexStructure(colarr, index.getName(), index.isUnique(),
index.isConstraint, index.isForward);
}
示例3: updateTable
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
/**
* Used to update constrains to reflect structural changes in a table. Prior
* checks must ensure that this method does not throw.
*
* @param session Session
* @param oldTable reference to the old version of the table
* @param newTable reference to the new version of the table
* @param colIndex index at which table column is added or removed
* @param adjust -1, 0, +1 to indicate if column is added or removed
*/
void updateTable(Session session, Table oldTable, Table newTable,
int colIndex, int adjust) {
if (oldTable == core.mainTable) {
core.mainTable = newTable;
if (core.mainIndex != null) {
core.mainIndex =
core.mainTable.getIndex(core.mainIndex.getName().name);
core.mainCols = ArrayUtil.toAdjustedColumnArray(core.mainCols,
colIndex, adjust);
}
}
if (oldTable == core.refTable) {
core.refTable = newTable;
if (core.refIndex != null) {
core.refIndex =
core.refTable.getIndex(core.refIndex.getName().name);
core.refCols = ArrayUtil.toAdjustedColumnArray(core.refCols,
colIndex, adjust);
}
}
// CHECK
if (constType == SchemaObject.ConstraintTypes.CHECK) {
recompile(session, newTable);
}
}
示例4: updateTable
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
/**
* Used to update constrains to reflect structural changes in a table. Prior
* checks must ensure that this method does not throw.
*
* @param session Session
* @param oldTable reference to the old version of the table
* @param newTable referenct to the new version of the table
* @param colIndex index at which table column is added or removed
* @param adjust -1, 0, +1 to indicate if column is added or removed
* @
*/
void updateTable(Session session, Table oldTable, Table newTable,
int colIndex, int adjust) {
if (oldTable == core.mainTable) {
core.mainTable = newTable;
if (core.mainIndex != null) {
core.mainIndex =
core.mainTable.getIndex(core.mainIndex.getName().name);
core.mainCols = ArrayUtil.toAdjustedColumnArray(core.mainCols,
colIndex, adjust);
}
}
if (oldTable == core.refTable) {
core.refTable = newTable;
if (core.refIndex != null) {
core.refIndex =
core.refTable.getIndex(core.refIndex.getName().name);
core.refCols = ArrayUtil.toAdjustedColumnArray(core.refCols,
colIndex, adjust);
}
}
// CHECK
if (constType == CHECK) {
recompile(session, newTable);
}
}
示例5: updateTable
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
/**
* Used to update constrains to reflect structural changes in a table. Prior
* checks must ensure that this method does not throw.
*
* @param session Session
* @param oldTable reference to the old version of the table
* @param newTable referenct to the new version of the table
* @param colIndex index at which table column is added or removed
* @param adjust -1, 0, +1 to indicate if column is added or removed
*/
void updateTable(Session session, Table oldTable, Table newTable,
int colIndex, int adjust) {
if (oldTable == core.mainTable) {
core.mainTable = newTable;
if (core.mainIndex != null) {
core.mainIndex =
core.mainTable.getIndex(core.mainIndex.getName().name);
core.mainCols = ArrayUtil.toAdjustedColumnArray(core.mainCols,
colIndex, adjust);
core.mainIndex.setTable(newTable);
}
}
if (oldTable == core.refTable) {
core.refTable = newTable;
if (core.refIndex != null) {
core.refIndex =
core.refTable.getIndex(core.refIndex.getName().name);
core.refCols = ArrayUtil.toAdjustedColumnArray(core.refCols,
colIndex, adjust);
core.refIndex.setTable(newTable);
}
}
// CHECK
if (constType == SchemaObject.ConstraintTypes.CHECK) {
recompile(session, newTable);
}
}
示例6: replaceTable
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
/**
* Used to update constrains to reflect structural changes in a table.
* Prior checks must ensure that this method does not throw.
*
* @param oldt reference to the old version of the table
* @param newt referenct to the new version of the table
* @param colindex index at which table column is added or removed
* @param adjust -1, 0, +1 to indicate if column is added or removed
* @throws HsqlException
*/
void replaceTable(Table oldt, Table newt, int colindex,
int adjust) throws HsqlException {
if (oldt == core.mainTable) {
core.mainTable = newt;
// excluede CHECK
if (core.mainIndex != null) {
core.mainIndex =
core.mainTable.getIndex(core.mainIndex.getName().name);
core.mainColArray =
ArrayUtil.toAdjustedColumnArray(core.mainColArray,
colindex, adjust);
}
}
if (oldt == core.refTable) {
core.refTable = newt;
if (core.refIndex != null) {
core.refIndex =
core.refTable.getIndex(core.refIndex.getName().name);
if (core.refIndex != core.mainIndex) {
core.refColArray =
ArrayUtil.toAdjustedColumnArray(core.refColArray,
colindex, adjust);
}
}
}
}
示例7: replaceTable
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
/**
* Used to update constrains to reflect structural changes in a table.
* Prior checks must ensure that this method does not throw.
*
* @param oldt reference to the old version of the table
* @param newt referenct to the new version of the table
* @param colindex index at which table column is added or removed
* @param adjust -1, 0, +1 to indicate if column is added or removed
* @throws HsqlException
*/
void replaceTable(Table oldt, Table newt, int colindex,
int adjust) throws HsqlException {
if (oldt == core.mainTable) {
core.mainTable = newt;
// exclude CHECK
if (core.mainIndex != null) {
core.mainIndex =
core.mainTable.getIndex(core.mainIndex.getName().name);
core.mainColArray =
ArrayUtil.toAdjustedColumnArray(core.mainColArray,
colindex, adjust);
}
}
if (oldt == core.refTable) {
core.refTable = newt;
if (core.refIndex != null) {
core.refIndex =
core.refTable.getIndex(core.refIndex.getName().name);
if (core.refIndex != core.mainIndex) {
core.refColArray =
ArrayUtil.toAdjustedColumnArray(core.refColArray,
colindex, adjust);
}
}
}
}