Package org.hsqldb.lib

Examples of org.hsqldb.lib.HsqlArrayList


    /**
     * called after the completion of defrag
     */
    public void setIndexRoots(int[][] roots) {

        HsqlArrayList allTables = database.schemaManager.getAllTables();

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

            if (t.getTableType() == TableBase.CACHED_TABLE) {
                int[] rootsArray = roots[i];

                if (roots != null) {
View Full Code Here


        if (!token.equalsIgnoreCase(Tokens.T_LEFTBRACKET)) {
            throw Error.error(ErrorCode.X_42584);
        }

        HsqlArrayList list = new HsqlArrayList();

        noSeparators = true;

        for (int i = 0; ; i++) {
            if (scanner.scanSpecialIdentifier(Tokens.T_RIGHTBRACKET)) {
                break;
            }

            if (i > 0) {
                if (!scanner.scanSpecialIdentifier(Tokens.T_COMMA)) {
                    throw Error.error(ErrorCode.X_42584);
                }
            }

            Object value = readData(type);

            list.add(value);
        }

        noSeparators = false;

        Object[] data = new Object[list.size()];

        list.toArray(data);

        return data;
    }
View Full Code Here

     * drop all schemas with the given authorisation
     */
    public void dropSchemas(Session session, Grantee grantee,
                            boolean cascade) {

        HsqlArrayList list = getSchemas(grantee);
        Iterator      it   = list.iterator();

        while (it.hasNext()) {
            Schema schema = (Schema) it.next();

            dropSchema(session, schema.getName().name, cascade);
View Full Code Here

        }
    }

    public HsqlArrayList getSchemas(Grantee grantee) {

        HsqlArrayList list = new HsqlArrayList();
        Iterator      it   = schemaMap.values().iterator();

        while (it.hasNext()) {
            Schema schema = (Schema) it.next();

            if (grantee.equals(schema.getOwner())) {
                list.add(schema);
            }
        }

        return list;
    }
View Full Code Here

     this Database.
     */
    public HsqlArrayList getAllTables() {

        Iterator      schemas   = allSchemaNameIterator();
        HsqlArrayList alltables = new HsqlArrayList();

        while (schemas.hasNext()) {
            String name = (String) schemas.next();

            if (SqlInvariants.isLobsSchemaName(name)) {
                continue;
            }

            if (SqlInvariants.isSystemSchemaName(name)) {
                continue;
            }

            HashMappedList current = getTables(name);

            alltables.addAll(current.values());
        }

        return alltables;
    }
View Full Code Here

    }

    public HsqlName[] getCatalogAndBaseTableNames() {

        OrderedHashSet names  = new OrderedHashSet();
        HsqlArrayList  tables = getAllTables();

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

            if (!table.isTemp()) {
                names.add(table.getName());
            }
        }
View Full Code Here

                    object.compile(session, null);
                    break;
            }
        }

        HsqlArrayList list = getAllTables();

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

            t.verifyConstraintsIntegrity();
        }
    }
View Full Code Here

    public String[] getSQLArray() {

        OrderedHashSet resolved   = new OrderedHashSet();
        OrderedHashSet unresolved = new OrderedHashSet();
        HsqlArrayList  list       = new HsqlArrayList();
        Iterator       schemas    = schemaMap.values().iterator();

        schemas = schemaMap.values().iterator();

        while (schemas.hasNext()) {
            Schema schema = (Schema) schemas.next();

            if (SqlInvariants.isSystemSchemaName(schema.getName().name)) {
                continue;
            }

            if (SqlInvariants.isLobsSchemaName(schema.getName().name)) {
                continue;
            }

            list.add(schema.getSQL());
            schema.addSimpleObjects(unresolved);
        }

        while (true) {
            Iterator it = unresolved.iterator();

            if (!it.hasNext()) {
                break;
            }

            OrderedHashSet newResolved = new OrderedHashSet();

            SchemaObjectSet.addAllSQL(resolved, unresolved, list, it,
                                      newResolved);
            unresolved.removeAll(newResolved);

            if (newResolved.size() == 0) {
                break;
            }
        }

        schemas = schemaMap.values().iterator();

        while (schemas.hasNext()) {
            Schema schema = (Schema) schemas.next();

            if (SqlInvariants.isLobsSchemaName(schema.getName().name)) {
                continue;
            }

            if (SqlInvariants.isSystemSchemaName(schema.getName().name)) {
                continue;
            }

            list.addAll(schema.getSQLArray(resolved, unresolved));
        }

        while (true) {
            Iterator it = unresolved.iterator();

            if (!it.hasNext()) {
                break;
            }

            OrderedHashSet newResolved = new OrderedHashSet();

            SchemaObjectSet.addAllSQL(resolved, unresolved, list, it,
                                      newResolved);
            unresolved.removeAll(newResolved);

            if (newResolved.size() == 0) {
                break;
            }
        }

        schemas = schemaMap.values().iterator();

        while (schemas.hasNext()) {
            Schema schema = (Schema) schemas.next();

            if (SqlInvariants.isLobsSchemaName(schema.getName().name)) {
                continue;
            }

            if (SqlInvariants.isSystemSchemaName(schema.getName().name)) {
                continue;
            }

            String[] t = schema.getTriggerSQL();

            if (t.length > 0) {
                list.add(Schema.getSetSchemaSQL(schema.getName()));
                list.addAll(t);
            }

            list.addAll(schema.getSequenceRestartSQL());
        }

        schemas = schemaMap.values().iterator();

        while (schemas.hasNext()) {
            Schema schema = (Schema) schemas.next();

            list.addAll(schema.getSequenceRestartSQL());
        }

        if (defaultSchemaHsqlName != null) {
            StringBuffer sb = new StringBuffer();

            sb.append(Tokens.T_SET).append(' ').append(Tokens.T_DATABASE);
            sb.append(' ').append(Tokens.T_DEFAULT).append(' ');
            sb.append(Tokens.T_INITIAL).append(' ').append(Tokens.T_SCHEMA);
            sb.append(' ').append(defaultSchemaHsqlName.statementName);
            list.add(sb.toString());
        }

        String[] array = new String[list.size()];

        list.toArray(array);

        return array;
    }
View Full Code Here

    public LobStoreMem(int lobBlockSize) {

        this.lobBlockSize = lobBlockSize;
        largeBlockSize    = lobBlockSize * blocksInLargeBlock;
        byteStoreList     = new HsqlArrayList();
    }
View Full Code Here

        super(compileContext);

        this.compileContext = compileContext;
        resultRangePosition = compileContext.getNextRangeVarIndex();
        rangeVariableList   = new HsqlArrayList();
        exprColumnList      = new HsqlArrayList();
        sortAndSlice        = SortAndSlice.noSort;
        isMergeable         = true;
    }
View Full Code Here

TOP

Related Classes of org.hsqldb.lib.HsqlArrayList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.