Hi,
we ran into the same problem Alex Li reported earlier (2002-07-02):
'Bug: dependent object OQL should always use "ORDER BY master.id"'
...
Not only result.size returning pretty too much columns, if there are
n dependent objects but also the LEFT OUTER JOINS combined with an
"order by" clause causes castor to return duplicate master objects each
containing only one out of n from the dependent objects. IMHO this is
because the result set (in my case from mysql) is unordered regarding
the master-id. Appending ", master.id" to a existing orderclause
fixes the problem.
I'd like to fix that, but someone has to tell me the right place -
should this be fixed while constructing the sql-query or when processing
the results? IMHO adding an "order by master.id" if no orderclause is given
or ", master.id" to the order clause of queries where master has dependent
classes in the mapping file.
I took a look into JDBCQueryExpression and ParseTreeWalker both constructing
the sql-query and I'm unsure where to get the master-tablename and the
id-columnname from. And will this fix the result.size() problem, too?
According to my tests it won't.
Regards,
Thomas
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev
- [castor-dev] How do I set XACT_ABORT ON with castor Thomas Klute
- [castor-dev] How do I set XACT_ABORT ON with castor Richard Lawson
