I think too. Collection must be replaced by hashmap, where key - is id
field or Complex object (e.q. identity of object).
Thanks!
-----Original Message-----
From: Richard Porter [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 02, 2003 1:55 AM
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] Bug with complex ORDER BY queries (in Oracle?)
Bruce,
Based on what I did to workaround the issue and Matthew's response
(though I haven't looked at the code so I'm not sure of its
implementation), I think what might work is something like this:
- Create a map to hold handles to the instances, keyed on identity
- On identity change, check that map for an entry
if found, continue populating its collections
if not found, create a new instance, add it to the map and to
the collection that is returned as the result set
If someone were to point me to the relevant classes and save me the
search time, I could probably code up a quick fix...of course, assuming
my suggestion would fit with the current implementation, it's not as
though it's very complicated for anyone to plug in.
Cheers!
Richard Porter
-----Original Message-----
From: Bruce Snyder [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 01, 2003 1:00 PM
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] Bug with complex ORDER BY queries (in Oracle?)
This one time, at band camp, Alexey A. Efimov said:
AAE>I think you must swap ORDER BY entries, becose REsultSet ordered in
AAE>unknown format for Castor, but it very strange. I mean that: If
AAE>first ordered by ORDER_ID ORDER_ID | BATCH_ID
AAE>1 1
AAE>1 2
AAE>1 3
AAE>2 1
AAE>3 1
AAE>3 2
AAE>3 4
AAE>
AAE>Castor look trough ResultSet and construct objects. It create 3
AAE>instance of Order, becose id follow in this nointerapteble order.
AAE>
AAE>So, if you order by BATCH_ID
AAE>ORDER_ID | BATCH_ID
AAE>1 1
AAE>2 1
AAE>3 1
AAE>1 2
AAE>3 2
AAE>1 3
AAE>3 4
AAE>
AAE>Now Castor create 7 objects, but 3 will with id = 1, 1 with id = 2
AAE>and 3 with id = 3.
AAE>
AAE>BUG in this thing!
AAE>
AAE>Bruce take look at this, please!! This is actualy bug, i guess.
I'm following the thread but I've been in meetings all day long for the
past two days. I'll first need to develop a JUnit test to reproduce this
so that I can then address the problem. I'll try to get started on this
tonight, but any help I can get from you guys would be a huge help.
Bruce
--
perl -e 'print
unpack("u30","<0G)[EMAIL PROTECTED]&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev