本文整理汇总了Java中org.hsqldb.types.Type.isIntegralType方法的典型用法代码示例。如果您正苦于以下问题:Java Type.isIntegralType方法的具体用法?Java Type.isIntegralType怎么用?Java Type.isIntegralType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.hsqldb.types.Type
的用法示例。
在下文中一共展示了Type.isIntegralType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: compileAlterColumnDataType
import org.hsqldb.types.Type; //导入方法依赖的package包/类
private Statement compileAlterColumnDataType(Table table,
ColumnSchema column) {
if (column.isGenerated()) {
throw Error.error(ErrorCode.X_42561);
}
Type type = readTypeDefinition(true, true);
if (column.isIdentity()) {
if (!type.isIntegralType()) {
throw Error.error(ErrorCode.X_42561);
}
}
String sql = getLastPart();
Object[] args = new Object[] {
StatementTypes.ALTER_COLUMN_TYPE, table, column, type
};
HsqlName[] writeLockNames =
database.schemaManager.getCatalogAndBaseTableNames(
table.getName());
return new StatementSchema(sql, StatementTypes.ALTER_TABLE, args,
null, writeLockNames);
}
示例2: compileAlterColumnDataTypeIdentity
import org.hsqldb.types.Type; //导入方法依赖的package包/类
/**
* Allows changes to type of column or addition / removal of an IDENTITY generator.
* IDENTITY is removed if it does not appear in new column definition
* Constraint definitions are not allowed
*/
private Statement compileAlterColumnDataTypeIdentity(Table table,
ColumnSchema column) {
if (column.isGenerated()) {
throw Error.error(ErrorCode.X_42561);
}
NumberSequence sequence = column.getIdentitySequence();
Type type = column.getDataType();
if (token.tokenType == Tokens.IDENTITY) {
read();
if (!type.isIntegralType()) {
throw Error.error(ErrorCode.X_42561);
}
if (sequence == null) {
sequence = new NumberSequence(null, type);
}
} else {
type = readTypeDefinition(true, true);
switch (token.tokenType) {
case Tokens.IDENTITY : {
if (!type.isIntegralType()) {
throw Error.error(ErrorCode.X_42561);
}
read();
if (sequence == null) {
sequence = new NumberSequence(null, type);
}
break;
}
case Tokens.GENERATED : {
sequence = readSequence(column);
break;
}
default :
sequence = null;
}
}
String sql = getLastPart();
Object[] args = new Object[] {
StatementTypes.ALTER_COLUMN_TYPE_IDENTITY, table, column, type,
sequence
};
HsqlName[] writeLockNames =
database.schemaManager.getCatalogAndBaseTableNames(
table.getName());
return new StatementSchema(sql, StatementTypes.ALTER_TABLE, args,
null, writeLockNames);
}
示例3: processAlterColumnType
import org.hsqldb.types.Type; //导入方法依赖的package包/类
/**
* Allows changes to type of column or addition of an IDENTITY generator.
* IDENTITY is not removed if it does not appear in new column definition
* Constraint definitions are not allowed
*/
private void processAlterColumnType(Table table, ColumnSchema oldCol, boolean fullDefinition) {
ColumnSchema newCol;
if (oldCol.isGenerated()) {
throw Error.error(ErrorCode.X_42561);
}
if (fullDefinition) {
HsqlArrayList list = new HsqlArrayList();
Constraint c = table.getPrimaryConstraint();
if (c == null) {
c = new Constraint(null, null, Constraint.TEMP);
}
list.add(c);
newCol = readColumnDefinitionOrNull(table, oldCol.getName(), list);
if (newCol == null) {
throw Error.error(ErrorCode.X_42000);
}
if (oldCol.isIdentity() && newCol.isIdentity()) {
throw Error.error(ErrorCode.X_42525);
}
if (list.size() > 1) {
throw Error.error(ErrorCode.X_42524);
}
} else {
Type type = readTypeDefinition(true);
if (oldCol.isIdentity()) {
if (!type.isIntegralType()) {
throw Error.error(ErrorCode.X_42561);
}
}
newCol = oldCol.duplicate();
newCol.setType(type);
}
TableWorks tw = new TableWorks(session, table);
tw.retypeColumn(oldCol, newCol);
}