Migrating from Beta 2's Manual Queries
This page is primarily for applications that are attempting to migrate from Beta 2 to Beta 3 and the new
Qcodo Query architecture.
The
default installation of Beta 3 does not offer support for the old Beta 2-style of Manual Queries.
Deprecated functionality includes
QueryHelper,
ArrayQueryHelper, and
QQueryExpansion,
as well as the string-based (hard coded)
SortBy and
LimitInfo parameters.
While the functionality in
Qcodo Query is going to be the future of Qcodo, this deprecation causes a particular painpoint
for developers wishing to migrate a Beta 2 codebase to Beta 3 and beyond, specifically with regards to custom
LoadArray methods.
While the ultimate solution would be to rewrite any modules still written in the old Beta 2-style, given time and other
constraints, this is often not a feasible solution.
There are a few mechanisms which helps provide
some assistance with backward compatability for applications and
developers in this situation. First off, the
codegen_settings.xml file now has a
<manualQuery support="true/false"/> tag
which takes in a boolean value. Setting this to
true will cause the codegen templates to include the original
QueryHelper and
ArrayQueryHelper functionality, including support for Beta 2-style
Object Expansion.
This will allow any Beta 2-style custom
Load and
LoadArray method to continue working in Beta 3.
In addition to this, the
QDataGridBase,
QPaginatedControl and
QDataGridColumn classes have all been retrofitted
with the original
SortBy and
LimitInfo properties which can now pass the original string-based parameters back and forth
to custom load methods. And in fact,
SortBy specifically can convert
simple QQ::OrderBy clauses into a string-based SortBy
command, too.
What this allows is for
custom "Beta 2"
DataGrids to be able to operate with your
custom "Beta 2"
LoadArray methods in a Beta 3 codebase (and beyond).
Unfortunately, one thing that will
not be able to be retrofitted to Beta 2 is any
code-generated LoadArray methods. These methods
will need to take in the new
QQ::OrderBy and
QQ:LimitInfo parameters, and will not be retrofitted to take in its string-based counterparts.
Only in this case, what this means is that if you have completely
custom "Beta 2"
DataGrids that load against
code-generated LoadArray methods,
then the datagrids will need to be slightly altered so that it is using
OrderByClause and
LimitClause instead of
the Beta 2-style
SortInfo and
LimitInfo properties. And specifically for
QDataGridColumns,
OrderByClause and
ReverseOrderByClause will need to be used instead of
SortByCommand and
ReverseSortByCommand.
And finally, obviously any
code-generated DataGrid will continue working with any
code-generated LoadArray method.
So, just to recap, a summary of what
DataGrid/
LoadArray pairs from Beta 2 will work in Beta 3:
|
Custom DataGrid |
Code Generated DataGrid (e.g. ListFormBase) |
| Custom LoadArray Method |
Should Work (requires manualQuery support="true") |
Not Applicable (by definition, code generated datagrids do not use custom Load methods) |
| Code Generated LoadArray Method |
Will Not Work (but only parts of the datagrid will need to be modified) |
Fully Functional (will utilize Qcodo Query) |
The example below shows a custom Beta 2-style
DataGrid and a custom Beta 2-style
LoadArray method working together...
even though the applicaiton is running "Qcodo 0.3.43 (Qcodo Beta 3)". The other example shows Beta 2-style
Object Expansion in
a custom
LoadArray method.