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


Java Table.MEMORY_TABLE属性代码示例

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


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

示例1: writeExistingData

protected void writeExistingData() throws HsqlException, IOException {

        boolean       wroteTable = false;
        HsqlArrayList tables     = db.getTables();

        for (int i = 0, size = tables.size(); i < size; i++) {
            Table t = (Table) tables.get(i);

            // write all memory table data
            // write cached table data unless index roots have been written
            // write all text table data apart from readonly text tables
            // unless index roots have been written
            boolean script = false;

            switch (t.getTableType()) {

                case Table.MEMORY_TABLE :
                    script = true;
                    break;

                case Table.CACHED_TABLE :
                    script = includeCachedData;
                    break;

                case Table.TEXT_TABLE :
                    script = includeCachedData &&!t.isReadOnly();
                    break;
            }

            try {
                if (script) {
                    writeTableInit(t);

                    RowIterator it = t.rowIterator();

                    while (it.hasNext()) {
                        writeRow(0, t, it.next().getData());
                    }

                    writeTableTerm(t);
                }
            } catch (Exception e) {
                throw Trace.error(Trace.ASSERT_FAILED, e.getMessage());
            }
        }

        writeDataTerm();
    }
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:48,代码来源:ScriptWriterBase.java

示例2: writeExistingData

protected void writeExistingData() throws HsqlException, IOException {

        // start with blank schema - SET SCHEMA to log
        currentSession.loggedSchema = null;

        Iterator schemas = database.schemaManager.userSchemaNameIterator();

        while (schemas.hasNext()) {
            String   schema = (String) schemas.next();
            Iterator tables = database.schemaManager.tablesIterator(schema);

            while (tables.hasNext()) {
                Table t = (Table) tables.next();

                // write all memory table data
                // write cached table data unless index roots have been written
                // write all text table data apart from readonly text tables
                // unless index roots have been written
                boolean script = false;

                switch (t.getTableType()) {

                    case Table.MEMORY_TABLE :
                        script = true;
                        break;

                    case Table.CACHED_TABLE :
                        script = includeCachedData;
                        break;

                    case Table.TEXT_TABLE :
                        script = includeCachedData &&!t.isReadOnly();
                        break;
                }

                int rowCount = 0;

                try {
                    if (script) {
                        schemaToLog = t.getName().schema;

                        writeTableInit(t);

                        RowIterator it = t.rowIterator(currentSession);

                        rowCount = 0;

                        while (it.hasNext()) {
                            writeRow(currentSession, t, it.next().getData());

                            rowCount++;
                        }

                        writeTableTerm(t);
                    }
                } catch (Throwable e) {
                    this.database.logger.appLog.logContext(
                        SimpleLog.LOG_ERROR,
                        t.getName().name + " problem after row " + rowCount);
                    System.gc();

                    throw Trace.error(Trace.ASSERT_FAILED, e.toString());
                }
            }
        }

        writeDataTerm();
    }
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:68,代码来源:ScriptWriterBase.java

示例3: writeExistingData

protected void writeExistingData() throws HsqlException, IOException {

        // start with blank schema - SET SCHEMA to log
        currentSession.loggedSchema = null;

        Iterator schemas = database.schemaManager.userSchemaNameIterator();

        while (schemas.hasNext()) {
            String   schema = (String) schemas.next();
            Iterator tables = database.schemaManager.tablesIterator(schema);

            while (tables.hasNext()) {
                Table t = (Table) tables.next();

                // write all memory table data
                // write cached table data unless index roots have been written
                // write all text table data apart from readonly text tables
                // unless index roots have been written
                boolean script = false;

                switch (t.getTableType()) {

                    case Table.MEMORY_TABLE :
                        script = true;
                        break;

                    case Table.CACHED_TABLE :
                        script = includeCachedData;
                        break;

                    case Table.TEXT_TABLE :
                        script = includeCachedData && !t.isReadOnly();
                        break;
                }

                int rowCount = 0;

                try {
                    if (script) {
                        schemaToLog = t.getName().schema;

                        writeTableInit(t);

                        RowIterator it = t.rowIterator(currentSession);

                        rowCount = 0;

                        while (it.hasNext()) {
                            writeRow(currentSession, t, it.next().getData());

                            rowCount++;
                        }

                        writeTableTerm(t);
                    }
                } catch (Throwable e) {
                    this.database.logger.appLog.logContext(
                        SimpleLog.LOG_ERROR,
                        t.getName().name + " problem after row " + rowCount);
                    System.gc();

                    throw Trace.error(Trace.ASSERT_FAILED, e.toString());
                }
            }
        }

        writeDataTerm();
    }
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:68,代码来源:ScriptWriterBase.java


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