Package org.hsqldb.lib

Examples of org.hsqldb.lib.OrderedHashSet


        if (roles.contains(name.schema.owner)) {
            return name.schema.owner.ownerRights;
        }

        OrderedHashSet set = getAllRoles();

        for (int i = 0; i < set.size(); i++) {
            Grantee role = (Grantee) set.get(i);

            if (name.schema.owner == role) {
                return role.ownerRights;
            }
        }
View Full Code Here


        if (isFullSelect) {
            selectColumnSet = null;
        } else if (right.selectColumnSet != null) {
            if (selectColumnSet == null) {
                selectColumnSet = new OrderedHashSet();
            }

            selectColumnSet.addAll(right.selectColumnSet);
        }

        if (isFullInsert) {
            insertColumnSet = null;
        } else if (right.insertColumnSet != null) {
            if (insertColumnSet == null) {
                insertColumnSet = new OrderedHashSet();
            }

            insertColumnSet.addAll(right.insertColumnSet);
        }

        if (isFullUpdate) {
            updateColumnSet = null;
        } else if (right.updateColumnSet != null) {
            if (updateColumnSet == null) {
                updateColumnSet = new OrderedHashSet();
            }

            updateColumnSet.addAll(right.updateColumnSet);
        }

        if (isFullReferences) {
            referencesColumnSet = null;
        } else if (right.referencesColumnSet != null) {
            if (referencesColumnSet == null) {
                referencesColumnSet = new OrderedHashSet();
            }

            referencesColumnSet.addAll(right.referencesColumnSet);
        }

        if (isFullTrigger) {
            triggerColumnSet = null;
        } else if (right.triggerColumnSet != null) {
            if (triggerColumnSet == null) {
                triggerColumnSet = new OrderedHashSet();
            }

            triggerColumnSet.addAll(right.triggerColumnSet);
        }
    }
View Full Code Here

        if (isFullSelect || isFullInsert || isFullUpdate || isFullReferences) {
            return table.getColumnNameSet();
        }

        OrderedHashSet set = new OrderedHashSet();

        if (selectColumnSet != null) {
            set.addAll(selectColumnSet);
        }

        if (insertColumnSet != null) {
            set.addAll(insertColumnSet);
        }

        if (updateColumnSet != null) {
            set.addAll(updateColumnSet);
        }

        if (referencesColumnSet != null) {
            set.addAll(referencesColumnSet);
        }

        return set;
    }
View Full Code Here

                row[is_grantable] = "YES";

                t.insertSys(store, row);
            }
        } else {
            OrderedHashSet roles = role.getDirectRoles();

            for (int i = 0; i < roles.size(); i++) {
                String   roleName = (String) roles.get(i);
                Object[] row      = t.getEmptyRowData();

                row[grantee]      = role.getNameString();
                row[role_name]    = roleName;
                row[is_grantable] = Tokens.T_NO;
View Full Code Here

        PersistentStore store = session.sessionData.getRowStore(t);

        // Intermediate holders
        Iterator       constraints;
        Constraint     constraint;
        OrderedHashSet references;
        RoutineSchema  routine;
        Object[]       row;

        constraints = database.schemaManager.databaseObjectIterator(
            SchemaObject.CONSTRAINT);

        while (constraints.hasNext()) {
            HsqlName constraintName = (HsqlName) constraints.next();

            if (constraintName.parent == null) {
                continue;
            }

            if (!session.getGrantee().isFullyAccessibleByRole(
                    constraintName.parent)) {
                continue;
            }

            switch (constraintName.parent.type) {

                case SchemaObject.TABLE : {
                    Table table;

                    try {
                        table = (Table) database.schemaManager.getSchemaObject(
                            constraintName.parent.name,
                            constraintName.parent.schema.name,
                            SchemaObject.TABLE);
                    } catch (Exception e) {
                        continue;
                    }

                    constraint = table.getConstraint(constraintName.name);

                    if (constraint.getConstraintType()
                            != SchemaObject.ConstraintTypes.CHECK) {
                        continue;
                    }

                    break;
                }
                case SchemaObject.DOMAIN : {
                    Type domain;

                    try {
                        domain = (Type) database.schemaManager.getSchemaObject(
                            constraintName.parent.name,
                            constraintName.parent.schema.name,
                            SchemaObject.DOMAIN);
                    } catch (Exception e) {
                        continue;
                    }

                    constraint = domain.userTypeModifier.getConstraint(
                        constraintName.name);
                }
                default :
                    continue;
            }

            references = constraint.getReferences();

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

                if (name.type != SchemaObject.SPECIFIC_ROUTINE) {
                    continue;
                }
View Full Code Here

        // intermediate holders
        int            columnCount;
        Iterator       tables;
        Table          table;
        Object[]       row;
        OrderedHashSet columnList;
        Type           type;

        // Initialization
        tables = allTables();

        while (tables.hasNext()) {
            table = (Table) tables.next();
            columnList =
                session.getGrantee().getColumnsForAllPrivileges(table);

            if (columnList.isEmpty()) {
                continue;
            }

            columnCount = table.getColumnCount();

            for (int i = 0; i < columnCount; i++) {
                ColumnSchema column = table.getColumn(i);

                type = column.getDataType();

                if (!columnList.contains(column.getName())) {
                    continue;
                }

                row                   = t.getEmptyRowData();
                row[table_cat]        = database.getCatalogName().name;
View Full Code Here

                constraintName = constraint.getName().name;

                switch (constraint.getConstraintType()) {

                    case SchemaObject.ConstraintTypes.CHECK : {
                        OrderedHashSet expressions =
                            constraint.getCheckColumnExpressions();

                        if (expressions == null) {
                            break;
                        }

                        iterator = expressions.iterator();

                        // calculate distinct column references
                        while (iterator.hasNext()) {
                            ExpressionColumn expr =
                                (ExpressionColumn) iterator.next();
View Full Code Here

            }

            Routine[] specifics = routine.getSpecificRoutines();

            for (int m = 0; m < specifics.length; m++) {
                OrderedHashSet set = specifics[m].getReferences();

                for (int i = 0; i < set.size(); i++) {
                    HsqlName refName = (HsqlName) set.get(i);

                    if (refName.type != SchemaObject.COLUMN) {
                        continue;
                    }
View Full Code Here

        // intermediate holders
        Iterator      routines;
        RoutineSchema routine;
        Object[]      row;
        OrderedHashSet grantees =
            session.getGrantee().getGranteeAndAllRolesWithPublic();

        routines = database.schemaManager.databaseObjectIterator(
            SchemaObject.ROUTINE);

        while (routines.hasNext()) {
            routine = (RoutineSchema) routines.next();

            for (int i = 0; i < grantees.size(); i++) {
                granteeObject = (Grantee) grantees.get(i);

                OrderedHashSet rights =
                    granteeObject.getAllDirectPrivileges(routine);
                OrderedHashSet grants =
                    granteeObject.getAllGrantedPrivileges(routine);

                if (!grants.isEmpty()) {
                    grants.addAll(rights);

                    rights = grants;
                }

                for (int j = 0; j < rights.size(); j++) {
View Full Code Here

        }
    }

    Statement compileSelectSingleRowStatement(RangeVariable[] rangeVars) {

        OrderedHashSet     variableNames = new OrderedHashSet();
        QuerySpecification select        = XreadSelect();
        Type[]             targetTypes;
        LongDeque          colIndexList = new LongDeque();

        readThis(Tokens.INTO);
        readTargetSpecificationList(variableNames, rangeVars, colIndexList);
        XreadTableExpression(select);
        select.setReturningResult();

        int[] columnMap = new int[colIndexList.size()];

        colIndexList.toArray(columnMap);

        Expression[] variables = new Expression[variableNames.size()];

        variableNames.toArray(variables);

        targetTypes = new Type[variables.length];

        for (int i = 0; i < variables.length; i++) {
            if (variables[i].getColumn().getParameterMode()
View Full Code Here

TOP

Related Classes of org.hsqldb.lib.OrderedHashSet

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.