use of org.hsqldb_voltpatches.lib.OrderedHashSet in project voltdb by VoltDB.
the class RangeVariable method getColumnNames.
public OrderedHashSet getColumnNames() {
if (columnNames == null) {
columnNames = new OrderedHashSet();
rangeTable.getColumnNames(this.usedColumns, columnNames);
}
return columnNames;
}
use of org.hsqldb_voltpatches.lib.OrderedHashSet in project voltdb by VoltDB.
the class Grantee method getAllRoles.
/**
* Gets direct and indirect roles.
*/
public OrderedHashSet getAllRoles() {
OrderedHashSet set = getGranteeAndAllRoles();
// Since we added "Grantee" in addition to Roles, need to remove self.
set.remove(this);
return set;
}
use of org.hsqldb_voltpatches.lib.OrderedHashSet in project voltdb by VoltDB.
the class Grantee method getAllDirectPrivileges.
public OrderedHashSet getAllDirectPrivileges(SchemaObject object) {
if (object.getOwner() == this) {
OrderedHashSet set = new OrderedHashSet();
set.add(ownerRights);
return set;
}
Iterator rights = directRightsMap.get(object.getName());
if (rights.hasNext()) {
OrderedHashSet set = new OrderedHashSet();
while (rights.hasNext()) {
set.add(rights.next());
}
return set;
}
return Right.emptySet;
}
use of org.hsqldb_voltpatches.lib.OrderedHashSet in project voltdb by VoltDB.
the class Constraint method getCheckColumnExpressions.
public OrderedHashSet getCheckColumnExpressions() {
OrderedHashSet set = new OrderedHashSet();
Expression.collectAllExpressions(set, check, Expression.columnExpressionSet, Expression.emptyExpressionSet);
return set;
}
use of org.hsqldb_voltpatches.lib.OrderedHashSet in project voltdb by VoltDB.
the class DatabaseInformationFull method VIEW_TABLE_USAGE.
/**
* The VIEW_TABLE_USAGE table has one row for each table identified
* by a <table name> simply contained in a <table reference>
* that is contained in the <query expression> of a view. <p>
*
* <b>Definition</b><p>
*
* <pre class="SqlCodeExample">
* CREATE TABLE SYSTEM_VIEW_TABLE_USAGE (
* VIEW_CATALOG VARCHAR NULL,
* VIEW_SCHEMA VARCHAR NULL,
* VIEW_NAME VARCHAR NULL,
* TABLE_CATALOG VARCHAR NULL,
* TABLE_SCHEMA VARCHAR NULL,
* TABLE_NAME VARCHAR NULL,
* UNIQUE( VIEW_CATALOG, VIEW_SCHEMA, VIEW_NAME,
* TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME )
* )
* </pre>
*
* <b>Description:</b><p>
*
* <ol>
* <li> The values of VIEW_CATALOG, VIEW_SCHEMA, and VIEW_NAME are the
* catalog name, unqualified schema name, and qualified identifier,
* respectively, of the view being described. <p>
*
* <li> The values of TABLE_CATALOG, TABLE_SCHEMA, and TABLE_NAME are the
* catalog name, unqualified schema name, and qualified identifier,
* respectively, of a table identified by a <table name>
* simply contained in a <table reference> that is contained in
* the <query expression> of the view being described.
* </ol>
*
* @return Table
*/
Table VIEW_TABLE_USAGE() {
Table t = sysTables[VIEW_TABLE_USAGE];
if (t == null) {
t = createBlankTable(sysTableHsqlNames[VIEW_TABLE_USAGE]);
addColumn(t, "VIEW_CATALOG", SQL_IDENTIFIER);
addColumn(t, "VIEW_SCHEMA", SQL_IDENTIFIER);
// not null
addColumn(t, "VIEW_NAME", SQL_IDENTIFIER);
addColumn(t, "TABLE_CATALOG", SQL_IDENTIFIER);
addColumn(t, "TABLE_SCHEMA", SQL_IDENTIFIER);
// not null
addColumn(t, "TABLE_NAME", SQL_IDENTIFIER);
// false PK, as VIEW_CATALOG, VIEW_SCHEMA, TABLE_CATALOG, and/or
// TABLE_SCHEMA may be NULL
HsqlName name = HsqlNameManager.newInfoSchemaObjectName(sysTableHsqlNames[VIEW_TABLE_USAGE].name, false, SchemaObject.INDEX);
t.createPrimaryKey(name, new int[] { 0, 1, 2, 3, 4, 5 }, false);
return t;
}
// Column number mappings
final int view_catalog = 0;
final int view_schema = 1;
final int view_name = 2;
final int table_catalog = 3;
final int table_schema = 4;
final int table_name = 5;
//
PersistentStore store = database.persistentStoreCollection.getStore(t);
Iterator tables;
Table table;
Object[] row;
// Initialization
tables = database.schemaManager.databaseObjectIterator(SchemaObject.TABLE);
// Do it.
while (tables.hasNext()) {
table = (Table) tables.next();
if (table.isView() && session.getGrantee().isFullyAccessibleByRole(table)) {
// $FALL-THROUGH$
} else {
continue;
}
OrderedHashSet references = table.getReferences();
for (int i = 0; i < references.size(); i++) {
HsqlName refName = (HsqlName) references.get(i);
if (!session.getGrantee().isFullyAccessibleByRole(refName)) {
continue;
}
if (refName.type != SchemaObject.TABLE) {
continue;
}
row = t.getEmptyRowData();
row[view_catalog] = database.getCatalogName().name;
row[view_schema] = table.getSchemaName().name;
row[view_name] = table.getName().name;
row[table_catalog] = database.getCatalogName().name;
row[table_schema] = refName.schema.name;
row[table_name] = refName.name;
try {
t.insertSys(store, row);
} catch (HsqlException e) {
}
}
}
return t;
}
Aggregations