Search in sources :

Example 11 with OrderedHashSet

use of org.hsqldb_voltpatches.lib.OrderedHashSet in project voltdb by VoltDB.

the class Table method getComponents.

@Override
public OrderedHashSet getComponents() {
    OrderedHashSet set = new OrderedHashSet();
    set.addAll(constraintList);
    set.addAll(triggerList);
    for (int i = 0; i < indexList.length; i++) {
        if (!indexList[i].isConstraint()) {
            set.add(indexList[i]);
        }
    }
    return set;
}
Also used : OrderedHashSet(org.hsqldb_voltpatches.lib.OrderedHashSet)

Example 12 with OrderedHashSet

use of org.hsqldb_voltpatches.lib.OrderedHashSet in project voltdb by VoltDB.

the class Grantee method getGranteeAndAllRolesWithPublic.

public OrderedHashSet getGranteeAndAllRolesWithPublic() {
    OrderedHashSet set = new OrderedHashSet();
    addGranteeAndRoles(set);
    set.add(granteeManager.publicRole);
    return set;
}
Also used : OrderedHashSet(org.hsqldb_voltpatches.lib.OrderedHashSet)

Example 13 with OrderedHashSet

use of org.hsqldb_voltpatches.lib.OrderedHashSet in project voltdb by VoltDB.

the class Grantee method getAllGrantableRights.

public Right getAllGrantableRights(SchemaObject object) {
    if (isAdmin) {
        return object.getOwner().ownerRights;
    }
    if (object.getOwner() == this) {
        return ownerRights;
    }
    if (roles.contains(object.getOwner())) {
        return object.getOwner().ownerRights;
    }
    OrderedHashSet set = getAllRoles();
    for (int i = 0; i < set.size(); i++) {
        Grantee role = (Grantee) set.get(i);
        if (object.getOwner() == role) {
            return role.ownerRights;
        }
    }
    Right right = (Right) fullRightsMap.get(object.getName());
    return right == null || right.grantableRights == null ? Right.noRights : right.grantableRights;
}
Also used : OrderedHashSet(org.hsqldb_voltpatches.lib.OrderedHashSet)

Example 14 with OrderedHashSet

use of org.hsqldb_voltpatches.lib.OrderedHashSet in project voltdb by VoltDB.

the class Grantee method getGranteeAndAllRoles.

public OrderedHashSet getGranteeAndAllRoles() {
    OrderedHashSet set = new OrderedHashSet();
    addGranteeAndRoles(set);
    return set;
}
Also used : OrderedHashSet(org.hsqldb_voltpatches.lib.OrderedHashSet)

Example 15 with OrderedHashSet

use of org.hsqldb_voltpatches.lib.OrderedHashSet in project voltdb by VoltDB.

the class ParserCommand method compileLock.

private Statement compileLock() {
    read();
    readThis(Tokens.TABLE);
    OrderedHashSet readSet = new OrderedHashSet();
    OrderedHashSet writeSet = new OrderedHashSet();
    outerloop: while (true) {
        Table table = readTableName();
        switch(token.tokenType) {
            case Tokens.READ:
                read();
                readSet.add(table.getName());
                break;
            case Tokens.WRITE:
                read();
                writeSet.add(table.getName());
                break;
            default:
                throw unexpectedToken();
        }
        if (token.tokenType == Tokens.COMMA) {
            read();
            continue;
        }
        break outerloop;
    }
    HsqlName[] readTableNames = new HsqlName[readSet.size()];
    readSet.toArray(readTableNames);
    HsqlName[] writeTableNames = new HsqlName[writeSet.size()];
    writeSet.toArray(writeTableNames);
    Statement cs = new StatementSession(StatementTypes.TRANSACTION_LOCK_TABLE, readTableNames, writeTableNames);
    return cs;
}
Also used : OrderedHashSet(org.hsqldb_voltpatches.lib.OrderedHashSet) HsqlName(org.hsqldb_voltpatches.HsqlNameManager.HsqlName)

Aggregations

OrderedHashSet (org.hsqldb_voltpatches.lib.OrderedHashSet)86 HsqlName (org.hsqldb_voltpatches.HsqlNameManager.HsqlName)47 Iterator (org.hsqldb_voltpatches.lib.Iterator)26 WrapperIterator (org.hsqldb_voltpatches.lib.WrapperIterator)24 Constraint (org.hsqldb_voltpatches.Constraint)19 SchemaObject (org.hsqldb_voltpatches.SchemaObject)19 PersistentStore (org.hsqldb_voltpatches.persist.PersistentStore)19 Table (org.hsqldb_voltpatches.Table)18 HsqlException (org.hsqldb_voltpatches.HsqlException)16 TextTable (org.hsqldb_voltpatches.TextTable)16 HsqlArrayList (org.hsqldb_voltpatches.lib.HsqlArrayList)11 HsqlList (org.hsqldb_voltpatches.lib.HsqlList)8 Grantee (org.hsqldb_voltpatches.rights.Grantee)6 Routine (org.hsqldb_voltpatches.Routine)5 RoutineSchema (org.hsqldb_voltpatches.RoutineSchema)5 Right (org.hsqldb_voltpatches.rights.Right)5 TriggerDef (org.hsqldb_voltpatches.TriggerDef)4 OrderedIntHashSet (org.hsqldb_voltpatches.lib.OrderedIntHashSet)3 Type (org.hsqldb_voltpatches.types.Type)3 HashMappedList (org.hsqldb_voltpatches.lib.HashMappedList)2