Package org.hsqldb.lib

Examples of org.hsqldb.lib.Iterator


     *  tables and views. This includes all tables and views registered with
     *  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;
            }

View Full Code Here


        return schema.schemaObjectIterator(type);
    }

    public Iterator databaseObjectIterator(int type) {

        Iterator it      = schemaMap.values().iterator();
        Iterator objects = new WrapperIterator();

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

            objects = new WrapperIterator(objects,
View Full Code Here

    }

    OrderedHashSet getReferencingObjectNames(HsqlName object) {

        OrderedHashSet set = new OrderedHashSet();
        Iterator       it  = referenceMap.get(object);

        while (it.hasNext()) {
            HsqlName name = (HsqlName) it.next();

            set.add(name);
        }

        return set;
View Full Code Here

    public OrderedHashSet getReferencingObjectNames(HsqlName table,
            HsqlName column) {

        OrderedHashSet set = new OrderedHashSet();
        Iterator       it  = referenceMap.get(table);

        while (it.hasNext()) {
            HsqlName       name       = (HsqlName) it.next();
            SchemaObject   object     = getSchemaObject(name);
            OrderedHashSet references = object.getReferences();

            if (references.contains(column)) {
                set.add(name);
View Full Code Here

    //
    public void getCascadingReferencingObjectNames(HsqlName object,
            OrderedHashSet set) {

        OrderedHashSet newSet = new OrderedHashSet();
        Iterator       it     = referenceMap.get(object);

        while (it.hasNext()) {
            HsqlName name  = (HsqlName) it.next();
            boolean  added = set.add(name);

            if (added) {
                newSet.add(name);
            }
View Full Code Here

    //
    private void getCascadingSchemaReferences(HsqlName schema,
            OrderedHashSet set) {

        Iterator mainIterator = referenceMap.keySet().iterator();

        while (mainIterator.hasNext()) {
            HsqlName name = (HsqlName) mainIterator.next();

            if (name.schema != schema) {
                continue;
            }
View Full Code Here

                          refName.getSchemaQualifiedStatementName());
    }

    public void checkSchemaNameCanChange(HsqlName name) {

        Iterator it      = referenceMap.values().iterator();
        HsqlName refName = null;

        mainLoop:
        while (it.hasNext()) {
            refName = (HsqlName) it.next();

            switch (refName.type) {

                case SchemaObject.VIEW :
                case SchemaObject.ROUTINE :
View Full Code Here

                getCascadingReferencingObjectNames(name, objectSet);
                break;

            case SchemaObject.DOMAIN :
                OrderedHashSet set = getReferencingObjectNames(name);
                Iterator       it  = set.iterator();

                while (it.hasNext()) {
                    HsqlName ref = (HsqlName) it.next();

                    if (ref.type == SchemaObject.COLUMN) {
                        it.remove();
                    }
                }

                if (!set.isEmpty()) {
                    HsqlName objectName = (HsqlName) set.get(0);
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();
View Full Code Here

            sb.append(StringConverter.toQuotedString(table.getName().comment,
                    '\'', true));
            list.add(sb.toString());
        }

        Iterator it = databaseObjectIterator(SchemaObject.ROUTINE);

        while (it.hasNext()) {
            SchemaObject object = (SchemaObject) it.next();

            if (object.getName().comment == null) {
                continue;
            }
View Full Code Here

TOP

Related Classes of org.hsqldb.lib.Iterator

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.