I found out that the problem is exactly on this part of the code:
- if tableRegistry.has_key(currentClass):
- #DSM: Must keep the last parent needed
- #DSM: (to limit the number of join needed)
- tableRegistry[registryClass] = currentClass
- #DSM: Remove this class as it is a parent one
- #DSM: of a needed children
- del tableRegistry[currentClass]
- currentClass = currentClass.sqlmeta.parentClass
In this code, if we have a tableRegistry with classes A, B and C (as I explained in the last email), if B is BEFORE C on allClasses dictionary, the code removes A from tableRegistry upon B iteration and when it iterates on C, there's no A anymore, resulting in a wrong associantion {C: B} and not the correct {C: A}
My code iterates on a copy and checks all of them, even if they were excluded from the resulting list.
Regarding the lastParent, that is wrong indeed. I forgot to remove that line.
It's quite difficult to reproduce the problem because it happens when the dictionary is in a specific order, but I'll try to reproduce it. Anyway, I've been very successful on my code after this patch is applied.
Thanks,
2006/10/31, Oleg Broytmann <[EMAIL PROTECTED]>:
Hello!
On Fri, Oct 27, 2006 at 12:37:40AM -0300, Raphael Derosso Pereira wrote:
> This one does, but has a strange behaviour: The parent descendent joins are
> getting dupplicated.
Could it be because you've dropped the test
if registryClass.sqlmeta.table in tablesDict:
?
Also you have created
lastParent = parentClass
but is is not used anywhere. What is the purpose of it?
Can you produce a short test that shows the problem being fixed?
Oleg.
--
Oleg Broytmann http://phd.pp.ru/ [EMAIL PROTECTED]
Programmers don't die, they just GOSUB without RETURN.
--
Raphael Derosso Pereira
Engenheiro da Computação
icq: 4517421
msn: [EMAIL PROTECTED]
Phone: +55 41 3024-7430
Cel: +55 41 9661-4442
------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ sqlobject-discuss mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
