public RowType.Locator GetLocator(string name) { RowType.Locator locator = new RowType.Locator(); if (GetLocator(name, ref locator)) return locator; else throw new ESQLException(Properties.Resources.InvalidIdentifier, name); }
public RowType.Locator GetLocator(int ordinal) { foreach (ColumnBinding b in _columnBinding) { if (ordinal-- == 0) { RowType.Locator loc = new RowType.Locator(); loc.master = b.rnum; if (b.snum != -1) loc.detail = b.snum; return loc; } } throw new ESQLException(Properties.Resources.BadOrderByItem, ordinal); }
public override Resultset Get(QueryContext queryContext, object[] parameters) { Resultset source = ChildNodes[0].Get(queryContext, parameters); RowType.Locator[] locator = new RowType.Locator[_columns.Length]; int[] way = new int[_columns.Length]; Binder binder = new Binder(source); for (int k = 0; k < _columns.Length; k++) { Column col = _columns[k]; locator[k] = col.Name is String ? binder.GetLocator((string)col.Name) : binder.GetLocator(((int)col.Name) - 1); way[k] = col.Direction == SortDirection.Descending ? -1 : 1; } return new Resultset(source.RowType, new SorterContext(source, new ComplexComparer(locator, way))); }