use of org.apache.derby.iapi.sql.dictionary.TupleDescriptor in project derby by apache.
the class DataDictionaryImpl method locateSchemaRowBody.
private SchemaDescriptor locateSchemaRowBody(UUID schemaId, int isolationLevel, TransactionController tc) throws StandardException {
DataValueDescriptor UUIDStringOrderable;
TabInfoImpl ti = coreInfo[SYSSCHEMAS_CORE_NUM];
/* Use UUIDStringOrderable in both start and stop positions for scan */
UUIDStringOrderable = getIDValueAsCHAR(schemaId);
/* Set up the start/stop position for the scan */
ExecIndexRow keyRow = exFactory.getIndexableRow(1);
keyRow.setColumn(1, UUIDStringOrderable);
return getDescriptorViaIndex(SYSSCHEMASRowFactory.SYSSCHEMAS_INDEX2_ID, keyRow, (ScanQualifier[][]) null, ti, (TupleDescriptor) null, (List<TupleDescriptor>) null, SchemaDescriptor.class, false, isolationLevel, tc);
}
use of org.apache.derby.iapi.sql.dictionary.TupleDescriptor in project derby by apache.
the class DataDictionaryImpl method getTriggerDescriptor.
/**
* Get the stored prepared statement descriptor given
* a sps name.
*
* @param name The sps name.
* @param sd The schema descriptor.
*
* @return The TriggerDescriptor for the constraint.
*
* @exception StandardException Thrown on failure
*/
public TriggerDescriptor getTriggerDescriptor(String name, SchemaDescriptor sd) throws StandardException {
DataValueDescriptor schemaIDOrderable;
DataValueDescriptor triggerNameOrderable;
TabInfoImpl ti = getNonCoreTI(SYSTRIGGERS_CATALOG_NUM);
/* Use triggerNameOrderable and schemaIdOrderable in both start
* and stop position for scan.
*/
triggerNameOrderable = new SQLVarchar(name);
schemaIDOrderable = getIDValueAsCHAR(sd.getUUID());
/* Set up the start/stop position for the scan */
ExecIndexRow keyRow = exFactory.getIndexableRow(2);
keyRow.setColumn(1, triggerNameOrderable);
keyRow.setColumn(2, schemaIDOrderable);
return getDescriptorViaIndex(SYSTRIGGERSRowFactory.SYSTRIGGERS_INDEX2_ID, keyRow, (ScanQualifier[][]) null, ti, (TupleDescriptor) null, (List<TupleDescriptor>) null, TriggerDescriptor.class, false);
}
use of org.apache.derby.iapi.sql.dictionary.TupleDescriptor in project derby by apache.
the class DataDictionaryImpl method getTableDescriptorIndex2Scan.
/**
* Scan systables_index2 (tableid) for a match.
*
* @return TableDescriptor The matching descriptor, if any.
*
* @exception StandardException Thrown on failure
*/
private TableDescriptor getTableDescriptorIndex2Scan(String tableUUID) throws StandardException {
DataValueDescriptor tableIDOrderable;
TableDescriptor td;
TabInfoImpl ti = coreInfo[SYSTABLES_CORE_NUM];
/* Use tableIDOrderable in both start and stop position for scan.
*/
tableIDOrderable = new SQLChar(tableUUID);
/* Set up the start/stop position for the scan */
ExecIndexRow keyRow = exFactory.getIndexableRow(1);
keyRow.setColumn(1, tableIDOrderable);
td = getDescriptorViaIndex(SYSTABLESRowFactory.SYSTABLES_INDEX2_ID, keyRow, (ScanQualifier[][]) null, ti, (TupleDescriptor) null, (List<TupleDescriptor>) null, TableDescriptor.class, false);
return finishTableDescriptor(td);
}
use of org.apache.derby.iapi.sql.dictionary.TupleDescriptor in project derby by apache.
the class DataDictionaryImpl method getAliasDescriptor.
/**
* Get a AliasDescriptor given its UUID.
*
* @param uuid The UUID
*
* @return The AliasDescriptor for the alias.
*
* @exception StandardException Thrown on failure
*/
public AliasDescriptor getAliasDescriptor(UUID uuid) throws StandardException {
DataValueDescriptor UUIDStringOrderable;
TabInfoImpl ti = getNonCoreTI(SYSALIASES_CATALOG_NUM);
/* Use UUIDStringOrderable in both start and stop positions for scan */
UUIDStringOrderable = getIDValueAsCHAR(uuid);
/* Set up the start/stop position for the scan */
ExecIndexRow keyRow = exFactory.getIndexableRow(1);
keyRow.setColumn(1, UUIDStringOrderable);
return getDescriptorViaIndex(SYSALIASESRowFactory.SYSALIASES_INDEX2_ID, keyRow, (ScanQualifier[][]) null, ti, (TupleDescriptor) null, (List<TupleDescriptor>) null, AliasDescriptor.class, false);
}
use of org.apache.derby.iapi.sql.dictionary.TupleDescriptor in project derby by apache.
the class DataDictionaryImpl method getTableDescriptorIndex1Scan.
/**
* Scan systables_index1 (tablename, schemaid) for a match.
*
* @return TableDescriptor The matching descriptor, if any.
*
* @exception StandardException Thrown on failure
*/
private TableDescriptor getTableDescriptorIndex1Scan(String tableName, String schemaUUID) throws StandardException {
DataValueDescriptor schemaIDOrderable;
DataValueDescriptor tableNameOrderable;
TableDescriptor td;
TabInfoImpl ti = coreInfo[SYSTABLES_CORE_NUM];
/* Use tableNameOrderable and schemaIdOrderable in both start
* and stop position for scan.
*/
tableNameOrderable = new SQLVarchar(tableName);
schemaIDOrderable = new SQLChar(schemaUUID);
/* Set up the start/stop position for the scan */
ExecIndexRow keyRow = exFactory.getIndexableRow(2);
keyRow.setColumn(1, tableNameOrderable);
keyRow.setColumn(2, schemaIDOrderable);
td = getDescriptorViaIndex(SYSTABLESRowFactory.SYSTABLES_INDEX1_ID, keyRow, (ScanQualifier[][]) null, ti, (TupleDescriptor) null, (List<TupleDescriptor>) null, TableDescriptor.class, false);
return finishTableDescriptor(td);
}
Aggregations