|
From: | David Ayers |
Subject: | Re: GDL2 and object inheritance. |
Date: | Tue, 19 Apr 2005 16:12:50 +0200 |
User-agent: | Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.7) Gecko/20050414 |
Jim Fowler wrote:
Greetings. First off, I'm extremely impressed with gdl2 and gsweb; I'm now using it to manage the student pages for a summer math camp. My database schema has tables that inherit from other tables; this seems to confuse GDL2. In particular, the subclasses all share a sequence, but GDL2 doesn't seem know about this (although webobjects did, as it created the database). I currently band-aid GDL2 by changing the code that decides what the sequences should be named (e.g., "address_seq" is replaced with "contact_seq" in the postgres adaptor), but I'm wondering if there is a more elegant solution to this?
Hello Jim,Great to hear that you have GDL2 and GSWeb mostly working for you. I haven't been able to check whether inheritance (either vertical, horizontal or one-table mapping) actually works in GDL2. In fact I remember reading comments in the code that it probably doesn't. But if the only issue you've run into so far is the primary key generation, then let's see what we can do.
http://developer.apple.com/documentation/LegacyTechnologies/WebObjects/WebObjects_4.5/System/Library/Frameworks/EOAccess.framework/ObjC_classic/Classes/EOSQLExpression.html#//apple_ref/occ/clm/EOSQLExpression/primaryKeySupportStatementsForEntityGroup:documents that the sequences will be based on the externalName of the root entity via -primaryKeyRootName and that /seems/ to be what is implemented used in EOAccess but...
Looking at the implementation of the method itself and doing a little testing on WO reveals that the correct inheritance handling has been commented out since the initial import of the sources.
Looking at the Postgres95AdaptorChannel, I see that doesn't ust the primaryKeyRootName of the entity either.
I'll blindly fix & commit without much testing as I really don't have much free time right now. But if you still have an issue after this is committed, please feel free to file a bug report and if it turns out to be easily fixable, I'll try to squeeze it in. (A small test case would be really great also!)
Cheers, David
[Prev in Thread] | Current Thread | [Next in Thread] |