Manipulating LoadAll and LoadArrayBy Results
(Note: for more information about "QQ::"-related classes (a.k.a. Qcodo Query
), please refer to section 3 of the
All Code Genereated LoadAll
methods take in an optional
Qcodo Query Clauses
parameter, where you can specify an unlimited number of QQClause
objects, including (but not limited) functionality that handles ORDER BY
and Object Expansion
. We will
discuss Object Expansion
in the examples that deal with Late Binding
and Early Binding
. But for this example, we'll focus on using
to manipulate how the results come out of the database.
are actually really straightforward to use. Order By takes
in any number of Qcodo Query Node columns, followed by an optional boolean (to specify ascending/decending),
which will be used in a SQL ORDER BY clause in the SELECT statement. So you can simply say
to sort all the Person objects by last name.
takes in a Maximum Row Count, followed by an optional offset.
So if you specified "10, 4", the result set would contain at most 10 rows, starting with row #5
(the offset is based on a 0 index).
Depending on which database platform you are on, the database adapter will appropriately handle
how to deal with this Limit information.
As a final reminder, note that you can use either, both, more or none of these optional QQClause
parameters whenever you make your LoadAll