Package org.hsqldb_voltpatches.lib

Examples of org.hsqldb_voltpatches.lib.HsqlArrayList


        return array;
    }

    public String[] getSequenceRestartSQL() {

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

        while (it.hasNext()) {
            NumberSequence sequence = (NumberSequence) it.next();
            String         ddl      = sequence.getRestartSQL();

            list.add(ddl);
        }

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

        list.toArray(array);

        return array;
    }
View Full Code Here


        return array;
    }

    public String[] getTriggerSQL() {

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

        while (it.hasNext()) {
            Table    table = (Table) it.next();
            String[] ddl   = table.getTriggerSQL();

            list.addAll(ddl);
        }

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

        list.toArray(array);

        return array;
    }
View Full Code Here

        return position;
    }

    void addTableColumns(Expression expression, HashSet exclude) {

        HsqlArrayList list  = new HsqlArrayList();
        Table         table = getTable();
        int           count = table.getColumnCount();

        for (int i = 0; i < count; i++) {
            ColumnSchema column = table.getColumn(i);
            String columnName = columnAliases == null ? column.getName().name
                                                      : (String) columnAliases
                                                          .get(i);

            if (exclude != null && exclude.contains(columnName)) {
                continue;
            }

            Expression e = new ExpressionColumn(this, column, i);

            list.add(e);
        }

        Expression[] nodes = new Expression[list.size()];

        list.toArray(nodes);

        expression.nodes = nodes;
    }
View Full Code Here

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

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

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

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

        }
    }

    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.owner)) {
                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();
            HashMappedList current = getTables(name);

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

        return alltables;
    }
View Full Code Here

                    object.compile(session);
                    break;
            }
        }

        HsqlArrayList list = getAllTables();

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

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

    public String[] getSQLArray() {

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

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

            if (isSystemSchema(schema.name.name)) {
                continue;
            }

            if (isLobsSchema(schema.name.name)) {
                continue;
            }

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

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

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

            while (it.hasNext()) {
                SchemaObject   object     = (SchemaObject) it.next();
                OrderedHashSet references = object.getReferences();
                boolean        isResolved = true;

                for (int j = 0; j < references.size(); j++) {
                    HsqlName name = (HsqlName) references.get(j);

                    if (name.type == SchemaObject.COLUMN
                            || name.type == SchemaObject.CONSTRAINT) {
                        name = name.parent;
                    }

                    if (!resolved.contains(name)) {
                        isResolved = false;

                        break;
                    }
                }

                if (isResolved) {
                    if (object.getType() == SchemaObject.TABLE) {
                        list.addAll(((Table) object).getSQL(resolved,
                                                            unresolved));
                    } else {
                        list.add(object.getSQL());
                        resolved.add(object.getName());
                    }

                    it.remove();
                }
            }
        }

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

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

            if (database.schemaManager.isSystemSchema(schema.name.name)) {
                continue;
            }

            if (database.schemaManager.isLobsSchema(schema.name.name)) {

//                continue;
            }

            list.addAll(schema.getTriggerSQL());
            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 String[] getIndexRootsSQL() {

        Session       sysSession = database.sessionManager.getSysSession();
        HsqlArrayList tableList  = getAllTables();
        HsqlArrayList list       = new HsqlArrayList();

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

            if (t.isIndexCached() && !t.isEmpty(sysSession)) {
                String ddl = ((Table) tableList.get(i)).getIndexRootsSQL();

                if (ddl != null) {
                    list.add(ddl);
                }
            }
        }

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

        list.toArray(array);

        return array;
    }
View Full Code Here

        sessionId                   = id;
        database                    = db;
        this.user                   = user;
        this.sessionTimeZoneSeconds = timeZoneSeconds;
        this.timeZoneSeconds        = timeZoneSeconds;
        rowActionList               = new HsqlArrayList(true);
        waitingSessions             = new OrderedHashSet();
        tempSet                     = new OrderedHashSet();
        isAutoCommit                = autocommit;
        isReadOnly                  = readonly;
        isolationMode               = isolationModeDefault;
View Full Code Here

TOP

Related Classes of org.hsqldb_voltpatches.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.