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);
}
}
}
}
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;
}