Beispiel #1
0
        internal override SelectableScheme GetSelectableSchemeFor(int column, int originalColumn, Table table)
        {
            // First check if the given SelectableScheme is in the column_scheme array
            SelectableScheme scheme = columnScheme[column];

            if (scheme != null)
            {
                if (table == this)
                {
                    return(scheme);
                }

                return(scheme.GetSubsetScheme(table, originalColumn));
            }

            // If it isn't then we need to calculate it
            SelectableScheme ss;

            // Optimization: The table may be naturally ordered by a column.  If it
            // is we don't try to generate an ordered set.
            if (sortedAgainstColumn != -1 &&
                sortedAgainstColumn == column)
            {
                InsertSearch isop = new InsertSearch(this, column, CalculateRowReferenceList().Cast <int>());
                isop.RecordUid       = false;
                ss                   = isop;
                columnScheme[column] = ss;
                if (table != this)
                {
                    ss = ss.GetSubsetScheme(table, originalColumn);
                }
            }
            else
            {
                // Otherwise we must generate the ordered set from the information in
                // a parent index.
                Table parentTable = referenceList[vtTableInfo.IndexOfTable(column)];
                ss = parentTable.GetSelectableSchemeFor(vtTableInfo.AdjustColumnOffset(column), originalColumn, table);
                if (table == this)
                {
                    columnScheme[column] = ss;
                }
            }

            return(ss);
        }
Beispiel #2
0
        /// <inheritdoc/>
        public override DataObject GetValue(int column, long row)
        {
            int   tableNum    = JoinedTableInfo.IndexOfTable(column);
            Table parentTable = ReferenceTables[tableNum];

            if (row >= outerRowCount)
            {
                row = ReferenceRows[tableNum][(int)row - outerRowCount];
                return(parentTable.GetValue(JoinedTableInfo.AdjustColumnOffset(column), row));
            }

            if (outerRows[tableNum] == null)
            {
                // Special case, handling outer entries (NULL)
                return(new DataObject(TableInfo[column].DataType, null));
            }

            row = outerRows[tableNum][(int)row];
            return(parentTable.GetValue(JoinedTableInfo.AdjustColumnOffset(column), row));
        }