use of org.apache.derby.iapi.sql.dictionary.TupleDescriptor in project derby by apache.
the class DataDictionaryImpl method getTriggerDescriptor.
/**
* Get a TriggerDescriptor given its UUID.
*
* @param uuid The UUID
*
* @return The TriggerDescriptor for the constraint.
*
* @exception StandardException Thrown on failure
*/
public TriggerDescriptor getTriggerDescriptor(UUID uuid) throws StandardException {
TabInfoImpl ti = getNonCoreTI(SYSTRIGGERS_CATALOG_NUM);
DataValueDescriptor triggerIdOrderable = getIDValueAsCHAR(uuid);
/* Set up the start/stop position for the scan */
ExecIndexRow keyRow = exFactory.getIndexableRow(1);
keyRow.setColumn(1, triggerIdOrderable);
return getDescriptorViaIndex(SYSTRIGGERSRowFactory.SYSTRIGGERS_INDEX1_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 getSPSDescriptorIndex1Scan.
/**
* Scan sysschemas_index1 (stmtname, schemaid) for a match.
*
* @return SPSDescriptor The matching descriptor, if any.
*
* @exception StandardException Thrown on failure
*/
private SPSDescriptor getSPSDescriptorIndex1Scan(String stmtName, String schemaUUID) throws StandardException {
DataValueDescriptor schemaIDOrderable;
DataValueDescriptor stmtNameOrderable;
TabInfoImpl ti = getNonCoreTI(SYSSTATEMENTS_CATALOG_NUM);
/* Use stmtNameOrderable and schemaIdOrderable in both start
* and stop position for scan.
*/
stmtNameOrderable = new SQLVarchar(stmtName);
schemaIDOrderable = new SQLChar(schemaUUID);
/* Set up the start/stop position for the scan */
ExecIndexRow keyRow = exFactory.getIndexableRow(2);
keyRow.setColumn(1, stmtNameOrderable);
keyRow.setColumn(2, schemaIDOrderable);
SPSDescriptor spsd = getDescriptorViaIndex(SYSSTATEMENTSRowFactory.SYSSTATEMENTS_INDEX2_ID, keyRow, (ScanQualifier[][]) null, ti, (TupleDescriptor) null, (List<TupleDescriptor>) null, SPSDescriptor.class, false);
/*
** Set up the parameter defaults. We are only
** doing this when we look up by name because
** this is the only time we cache, and it can
** be foolish to look up the parameter defaults
** for someone that doesn't need them.
*/
if (spsd != null) {
List<DataValueDescriptor> tmpDefaults = new ArrayList<DataValueDescriptor>();
spsd.setParams(getSPSParams(spsd, tmpDefaults));
Object[] defaults = tmpDefaults.toArray();
spsd.setParameterDefaults(defaults);
}
return spsd;
}
use of org.apache.derby.iapi.sql.dictionary.TupleDescriptor in project derby by apache.
the class DataDictionaryImpl method locateSchemaRow.
/**
* Get the target schema by searching for a matching row
* in SYSSCHEMAS by schema name. Read only scan.
*
* @param schemaName The name of the schema we're interested in.
* If schemaId is null, used to qual.
*
* @param tc TransactionController. If null, one
* is gotten off of the language connection context.
*
* @return The row for the schema
*
* @exception StandardException Thrown on error
*/
private SchemaDescriptor locateSchemaRow(String schemaName, TransactionController tc) throws StandardException {
DataValueDescriptor schemaNameOrderable;
TabInfoImpl ti = coreInfo[SYSSCHEMAS_CORE_NUM];
/* Use aliasNameOrderable in both start
* and stop position for scan.
*/
schemaNameOrderable = new SQLVarchar(schemaName);
/* Set up the start/stop position for the scan */
ExecIndexRow keyRow = exFactory.getIndexableRow(1);
keyRow.setColumn(1, schemaNameOrderable);
return getDescriptorViaIndex(SYSSCHEMASRowFactory.SYSSCHEMAS_INDEX1_ID, keyRow, (ScanQualifier[][]) null, ti, (TupleDescriptor) null, (List<TupleDescriptor>) null, SchemaDescriptor.class, false, TransactionController.ISOLATION_REPEATABLE_READ, tc);
}
use of org.apache.derby.iapi.sql.dictionary.TupleDescriptor in project derby by apache.
the class DataDictionaryImpl method getFileInfoDescriptorIndex2Scan.
/**
* Scan sysfiles_index2 (id) for a match.
* @return TableDescriptor The matching descriptor, or null.
* @exception StandardException Thrown on failure
*/
private FileInfoDescriptor getFileInfoDescriptorIndex2Scan(UUID id) throws StandardException {
DataValueDescriptor idOrderable;
TabInfoImpl ti = getNonCoreTI(SYSFILES_CATALOG_NUM);
idOrderable = getIDValueAsCHAR(id);
/* Set up the start/stop position for the scan */
ExecIndexRow keyRow = exFactory.getIndexableRow(1);
keyRow.setColumn(1, idOrderable);
return getDescriptorViaIndex(SYSFILESRowFactory.SYSFILES_INDEX2_ID, keyRow, (ScanQualifier[][]) null, ti, (TupleDescriptor) null, (List<TupleDescriptor>) null, FileInfoDescriptor.class, false);
}
use of org.apache.derby.iapi.sql.dictionary.TupleDescriptor in project derby by apache.
the class DataDictionaryImpl method getSequenceDescriptor.
public SequenceDescriptor getSequenceDescriptor(UUID uuid) throws StandardException {
DataValueDescriptor UUIDStringOrderable;
TabInfoImpl ti = getNonCoreTI(SYSSEQUENCES_CATALOG_NUM);
/* Use UUIDStringOrderable in both start and stop position for
* scan.
*/
UUIDStringOrderable = getIDValueAsCHAR(uuid);
/* Set up the start/stop position for the scan */
ExecIndexRow keyRow = exFactory.getIndexableRow(1);
keyRow.setColumn(1, UUIDStringOrderable);
SequenceDescriptor sequenceDescriptor = getDescriptorViaIndex(SYSSEQUENCESRowFactory.SYSSEQUENCES_INDEX1_ID, keyRow, (ScanQualifier[][]) null, ti, (TupleDescriptor) null, (List<TupleDescriptor>) null, SequenceDescriptor.class, false);
putSequenceID(sequenceDescriptor);
return sequenceDescriptor;
}
Aggregations