当前位置: 首页>>代码示例>>Java>>正文


Java Type.isIntegralType方法代码示例

本文整理汇总了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);
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:27,代码来源:ParserDDL.java

示例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);
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:66,代码来源:ParserDDL.java

示例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);
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:55,代码来源:ParserDDL.java


注:本文中的org.hsqldb.types.Type.isIntegralType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。