private class Presorter.SortedResults extends SimpleResults
Results
which
presorts all query results according to the sort criteria
specified for this query. The sorting takes place during construction
of this object.Modifier and Type | Class and Description |
---|---|
private class |
Presorter.SortedResults.Row
A transient object which is used only during the presorting phase
and which is discarded once the results have been sorted (at which
time it is replaced with only the array of primary key IDs).
|
private class |
Presorter.SortedResults.RowComparator
Specialized comparator which uses the sort criteria previously added
to the query, along with the corresponding values resolved using
those criteria against each result row.
|
Modifier and Type | Field and Description |
---|---|
private Presorter.SortedResults.RowComparator |
comparator
Comparator used to presort rows
|
Modifier | Constructor and Description |
---|---|
private |
SortedResults(Results results)
Constructor which presorts all results according to this query's
sort criteria and retains a list of the primary key ID arrays
representing the records which comprise each result row.
|
cleanup, deleteRow, first, get, get, getID, getNumberOfLoadedRows, getRowNumber, getRows, isFirst, isLast, last, next, previous, reset, scroll, sessionClosing, setRowNumber
private final Presorter.SortedResults.RowComparator comparator
private SortedResults(Results results) throws PersistenceException
The sort is performed by accessing each result row returned by the
initial query execution. These rows are in no particular order, but
are visited from first to last. Each row consists of one or more
records. Each such record is loaded temporarily into its associated
record buffer. The resolvable data source for each sort criterion
is then asked to resolve its sort value, and these values are stored
into a sort key array in a temporary,
PresortQuery.SortedResults.Row
object within a list.
Once sort keys have been generated for all result rows, the list is
then sorted, primary key arrays for each row are preserved, and the
sort keys and original result set are discarded.
results
- Scrollable result set generated by the query. Unlike the
scrollable result set used by PreselectQuery
,
this result set actually contains full data records, not
just their primary key IDs.PersistenceException
- if there is an error evicting a temporary record from the
persistence session after it is used.