Search in sources :

Example 66 with HsqlArrayList

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

the class GranteeManager method getRightstSQL.

public String[] getRightstSQL() {
    HsqlArrayList list = new HsqlArrayList();
    Iterator grantees = getGrantees().iterator();
    while (grantees.hasNext()) {
        Grantee grantee = (Grantee) grantees.next();
        String name = grantee.getNameString();
        // _SYSTEM user, DBA Role grants not persisted
        if (GranteeManager.isImmutable(name)) {
            continue;
        }
        HsqlArrayList subList = grantee.getRightsSQL();
        list.addAll(subList);
    }
    String[] array = new String[list.size()];
    list.toArray(array);
    return array;
}
Also used : HsqlArrayList(org.hsqldb_voltpatches.lib.HsqlArrayList) Iterator(org.hsqldb_voltpatches.lib.Iterator)

Example 67 with HsqlArrayList

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

the class GranteeManager method getSQL.

public String[] getSQL() {
    HsqlArrayList list = new HsqlArrayList();
    // roles
    Iterator it = getRoles().iterator();
    while (it.hasNext()) {
        Grantee grantee = (Grantee) it.next();
        // ADMIN_ROLE_NAME is not persisted
        if (!GranteeManager.isReserved(grantee.getNameString())) {
            list.add(grantee.getSQL());
        }
    }
    // users
    it = getGrantees().iterator();
    for (; it.hasNext(); ) {
        Grantee grantee = (Grantee) it.next();
        if (grantee instanceof User) {
            list.add(grantee.getSQL());
        }
    }
    String[] array = new String[list.size()];
    list.toArray(array);
    return array;
}
Also used : HsqlArrayList(org.hsqldb_voltpatches.lib.HsqlArrayList) Iterator(org.hsqldb_voltpatches.lib.Iterator)

Example 68 with HsqlArrayList

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

the class Expression method checkValidCheckConstraint.

/**
     * checkValidCheckConstraint
     */
public void checkValidCheckConstraint() {
    HsqlArrayList set = new HsqlArrayList();
    Expression.collectAllExpressions(set, this, subqueryExpressionSet, emptyExpressionSet);
    if (!set.isEmpty()) {
        throw Error.error(ErrorCode.X_0A000, "subquery in check constraint");
    }
}
Also used : HsqlArrayList(org.hsqldb_voltpatches.lib.HsqlArrayList)

Example 69 with HsqlArrayList

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

the class Database method getSettingsSQL.

public String[] getSettingsSQL() {
    HsqlArrayList list = new HsqlArrayList();
    if (!getCatalogName().name.equals(HsqlNameManager.DEFAULT_CATALOG_NAME)) {
        String name = getCatalogName().statementName;
        list.add("ALTER CATALOG PUBLIC RENAME TO " + name);
    }
    if (collation.name != null) {
        String name = collation.getName().statementName;
        list.add("SET DATABASE COLLATION " + name);
    }
    String[] array = new String[list.size()];
    list.toArray(array);
    return array;
}
Also used : HsqlArrayList(org.hsqldb_voltpatches.lib.HsqlArrayList)

Aggregations

HsqlArrayList (org.hsqldb_voltpatches.lib.HsqlArrayList)69 HsqlName (org.hsqldb_voltpatches.HsqlNameManager.HsqlName)21 Iterator (org.hsqldb_voltpatches.lib.Iterator)14 HsqlList (org.hsqldb_voltpatches.lib.HsqlList)11 OrderedHashSet (org.hsqldb_voltpatches.lib.OrderedHashSet)10 WrapperIterator (org.hsqldb_voltpatches.lib.WrapperIterator)10 Table (org.hsqldb_voltpatches.Table)7 Type (org.hsqldb_voltpatches.types.Type)6 SchemaObject (org.hsqldb_voltpatches.SchemaObject)5 Method (java.lang.reflect.Method)4 Constraint (org.hsqldb_voltpatches.Constraint)3 HashMappedList (org.hsqldb_voltpatches.lib.HashMappedList)3 Grantee (org.hsqldb_voltpatches.rights.Grantee)3 PersistentStore (org.hsqldb_voltpatches.persist.PersistentStore)2 Result (org.hsqldb_voltpatches.result.Result)2 BufferedOutputStream (java.io.BufferedOutputStream)1 IOException (java.io.IOException)1 OutputStream (java.io.OutputStream)1 HSQLParseException (org.hsqldb_voltpatches.HSQLInterface.HSQLParseException)1 NumberSequence (org.hsqldb_voltpatches.NumberSequence)1