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


Java HsqlProperties.indexName方法代码示例

本文整理汇总了Java中org.hsqldb.persist.HsqlProperties.indexName方法的典型用法代码示例。如果您正苦于以下问题:Java HsqlProperties.indexName方法的具体用法?Java HsqlProperties.indexName怎么用?Java HsqlProperties.indexName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.hsqldb.persist.HsqlProperties的用法示例。


在下文中一共展示了HsqlProperties.indexName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: SYSTEM_CONNECTION_PROPERTIES

import org.hsqldb.persist.HsqlProperties; //导入方法依赖的package包/类
/**
 * getClientInfoProperties
 *
 * @return Result
 *
 * <li><b>NAME</b> String=> The name of the client info property<br>
 * <li><b>MAX_LEN</b> int=> The maximum length of the value for the property<br>
 * <li><b>DEFAULT_VALUE</b> String=> The default value of the property<br>
 * <li><b>DESCRIPTION</b> String=> A description of the property.  This will typically
 *                                                  contain information as to where this property is
 *                                                  stored in the database.
 */
final Table SYSTEM_CONNECTION_PROPERTIES(Session session,
        PersistentStore store) {

    Table t = sysTables[SYSTEM_CONNECTION_PROPERTIES];

    if (t == null) {
        t = createBlankTable(
            sysTableHsqlNames[SYSTEM_CONNECTION_PROPERTIES]);

        addColumn(t, "NAME", SQL_IDENTIFIER);
        addColumn(t, "MAX_LEN", Type.SQL_INTEGER);
        addColumn(t, "DEFAULT_VALUE", SQL_IDENTIFIER);    // not null
        addColumn(t, "DESCRIPTION", SQL_IDENTIFIER);      // not null

        HsqlName name = HsqlNameManager.newInfoSchemaObjectName(
            sysTableHsqlNames[SYSTEM_CONNECTION_PROPERTIES].name, false,
            SchemaObject.INDEX);

        t.createPrimaryKeyConstraint(name, new int[]{ 0 }, true);

        return t;
    }

    Object[] row;

    // column number mappings
    final int iname          = 0;
    final int imax_len       = 1;
    final int idefault_value = 2;
    final int idescription   = 3;
    Iterator  it = HsqlDatabaseProperties.getPropertiesMetaIterator();

    while (it.hasNext()) {
        Object[] meta = (Object[]) it.next();
        int propType =
            ((Integer) meta[HsqlProperties.indexType]).intValue();

        if (propType == HsqlDatabaseProperties.FILE_PROPERTY) {
            if (HsqlDatabaseProperties.hsqldb_readonly.equals(
                    meta[HsqlProperties.indexName]) || HsqlDatabaseProperties
                        .hsqldb_files_readonly.equals(
                            meta[HsqlProperties.indexName])) {}
            else {
                continue;
            }
        } else if (propType != HsqlDatabaseProperties.SQL_PROPERTY) {
            continue;
        }

        row = t.getEmptyRowData();

        Object def = meta[HsqlProperties.indexDefaultValue];

        row[iname]          = meta[HsqlProperties.indexName];
        row[imax_len]       = ValuePool.getInt(8);
        row[idefault_value] = def == null ? null
                                          : def.toString();
        row[idescription]   = "see HyperSQL guide";

        t.insertSys(session, store, row);
    }

    return t;
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:77,代码来源:DatabaseInformationMain.java

示例2: SYSTEM_CONNECTION_PROPERTIES

import org.hsqldb.persist.HsqlProperties; //导入方法依赖的package包/类
/**
 * getClientInfoProperties
 *
 * @return Result
 *
 * <li><b>NAME</b> String=> The name of the client info property<br>
 * <li><b>MAX_LEN</b> int=> The maximum length of the value for the property<br>
 * <li><b>DEFAULT_VALUE</b> String=> The default value of the property<br>
 * <li><b>DESCRIPTION</b> String=> A description of the property.  This will typically
 *                                                  contain information as to where this property is
 *                                                  stored in the database.
 */
final Table SYSTEM_CONNECTION_PROPERTIES(Session session,
        PersistentStore store) {

    Table t = sysTables[SYSTEM_CONNECTION_PROPERTIES];

    if (t == null) {
        t = createBlankTable(
            sysTableHsqlNames[SYSTEM_CONNECTION_PROPERTIES]);

        addColumn(t, "NAME", SQL_IDENTIFIER);
        addColumn(t, "MAX_LEN", Type.SQL_INTEGER);
        addColumn(t, "DEFAULT_VALUE", SQL_IDENTIFIER);    // not null
        addColumn(t, "DESCRIPTION", SQL_IDENTIFIER);      // not null

        HsqlName name = HsqlNameManager.newInfoSchemaObjectName(
            sysTableHsqlNames[SYSTEM_PRIMARYKEYS].name, false,
            SchemaObject.INDEX);

        t.createPrimaryKeyConstraint(name, new int[]{ 0 }, true);

        return t;
    }

    Object[] row;

    // column number mappings
    final int iname          = 0;
    final int imax_len       = 1;
    final int idefault_value = 2;
    final int idescription   = 3;
    Iterator  it = HsqlDatabaseProperties.getPropertiesMetaIterator();

    while (it.hasNext()) {
        Object[] meta = (Object[]) it.next();
        int propType =
            ((Integer) meta[HsqlProperties.indexType]).intValue();

        if (propType == HsqlDatabaseProperties.FILE_PROPERTY) {
            if (HsqlDatabaseProperties.hsqldb_readonly.equals(
                    meta[HsqlProperties.indexName]) || HsqlDatabaseProperties
                        .hsqldb_files_readonly.equals(
                            meta[HsqlProperties.indexName])) {}
            else {
                continue;
            }
        } else if (propType != HsqlDatabaseProperties.SQL_PROPERTY) {
            continue;
        }

        row = t.getEmptyRowData();

        Object def = meta[HsqlProperties.indexDefaultValue];

        row[iname]          = meta[HsqlProperties.indexName];
        row[imax_len]       = ValuePool.getInt(8);
        row[idefault_value] = def == null ? null
                                          : def.toString();
        row[idescription]   = "see HyperSQL guide";

        t.insertSys(session, store, row);
    }

    return t;
}
 
开发者ID:Julien35,项目名称:dev-courses,代码行数:77,代码来源:DatabaseInformationMain.java


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