db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dyre.Tjeldv...@Sun.COM
Subject FetchDescriptor constructors
Date Sun, 10 Dec 2006 14:45:39 GMT
Seems like FetchDescriptor has a constructor overload for the case
when only a singel column needs to be fetched:

    public FetchDescriptor(
    int             input_row_length,
    int             single_valid_column_number)
    {
        row_length        = input_row_length;
        maxFetchColumnId  = single_valid_column_number;
        validColumnsArray = new int[maxFetchColumnId + 1];
        validColumnsArray[single_valid_column_number] = 1;
    }

In BasePage.fetchFieldFromSlot one needs to create a FetchDescriptor
with a single column, but the general FetchDescriptor (requiring a
temporary FormatableBitSet to be created) is still used:

        public final RecordHandle fetchFieldFromSlot(
    int                 slot, 
    int                 fieldId, 
    Object column)
                throws StandardException
        {
        // need to allocate row with fieldId cols because of sparse row change
        // needs to be RESOLVED
                Object[] row = new Object[fieldId + 1];
                row[fieldId] = column;
                FormatableBitSet singleColumn = new FormatableBitSet(fieldId + 1
);

                singleColumn.set(fieldId);

        FetchDescriptor fetchDesc = 
            new FetchDescriptor(fieldId + 1, singleColumn,(Qualifier[][]) null);

                return(fetchFromSlot(null, slot, row, fetchDesc, true));
        }

Is there some hidden reason why the special FetchDescriptor
constructor cannot be used in this case?

-- 
dt


Mime
View raw message