Search in sources :

Example 1 with Right

use of com.wplatform.ddal.dbobject.Right in project jdbc-shards by wplatform.

the class Table method removeChildrenAndResources.

@Override
public void removeChildrenAndResources(Session session) {
    for (Right right : database.getAllRights()) {
        if (right.getGrantedTable() == this) {
            database.removeDatabaseObject(session, right);
        }
    }
    // before removing the table object)
    while (sequences != null && sequences.size() > 0) {
        Sequence sequence = sequences.get(0);
        sequences.remove(0);
        if (!isTemporary()) {
            // this is possible when calling ALTER TABLE ALTER COLUMN
            if (database.getDependentTable(sequence, this) == null) {
                database.removeSchemaObject(session, sequence);
            }
        }
    }
}
Also used : Right(com.wplatform.ddal.dbobject.Right) Sequence(com.wplatform.ddal.dbobject.schema.Sequence)

Example 2 with Right

use of com.wplatform.ddal.dbobject.Right in project jdbc-shards by wplatform.

the class Table method getChildren.

@Override
public ArrayList<DbObject> getChildren() {
    ArrayList<DbObject> children = New.arrayList();
    ArrayList<Index> indexes = getIndexes();
    if (indexes != null) {
        children.addAll(indexes);
    }
    if (sequences != null) {
        children.addAll(sequences);
    }
    ArrayList<Right> rights = database.getAllRights();
    for (Right right : rights) {
        if (right.getGrantedTable() == this) {
            children.add(right);
        }
    }
    return children;
}
Also used : DbObject(com.wplatform.ddal.dbobject.DbObject) Right(com.wplatform.ddal.dbobject.Right) Index(com.wplatform.ddal.dbobject.index.Index)

Aggregations

Right (com.wplatform.ddal.dbobject.Right)2 DbObject (com.wplatform.ddal.dbobject.DbObject)1 Index (com.wplatform.ddal.dbobject.index.Index)1 Sequence (com.wplatform.ddal.dbobject.schema.Sequence)1