Could it have to do with duplicated methods if using 2 alias's to the same table ? for example: person has one address record aliased as Mailing address and another aliased as billing address.
in this case you need to call personRecord.GetShippingAddress().getZipcode() and personRecord.GetBillingAddress().getZipcode() using personRecord.getZipcode() as you sugested would be ambigious. Doug S. On 10/10/06, Doug Hughes <[EMAIL PROTECTED]> wrote:
Eivind, This is an interesting request. Why? Because Reactor actually used to support this feature. (No?! What?!) Yes. That's right. Really old versions of Reactor did almost exactly what you're asking for. I'm wracking my brain, but, for the life of me, I can't remember why this was removed. It had something to do with.... something. Anyhow, I do this sorta database structure too. For now, what you can do is use the external fields feature to get read-only access to this data. For example, if you have a Foo object and it hasOne creator which had a field, full name, within your Foo object tag you could specify this field: <field source="Creator" field="fullName" alias="creatorFullName" /> This will give your FooRecord (and FooGateway) a creatorFullName field that you can access. If you modify this value in the Creator record it will update the parent automatically. (Or it should, if it doesn't.) Doug -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Eivind Kjorstad Sent: Tuesday, October 10, 2006 2:10 AM To: [email protected] Subject: Re: [Reactor for CF] Big speed update in latest commit Mark Stanton wrote: > Yes - that's what I mean - basically class table inheritance. We are > using a bunch of these. Will have a think about how this could work - > but off the top of my head having methods from the base record mixed > into the other record would seem to do it. > > So if you have a Shape record and a Triangle record - all of Shape's > methods would be available directly from Triangle. We do this a lot too. We have a table with base-attributes that are available for several classes of objects, and then add-on tables for those that are only available for a certain subclass of object. For example, we migth have a "person" object, and two subclasses "teacher" and "student". The properties common to all persons would be stored in the database-table "person", and only those fields that are specific to students or teachers would be stored in their own tables. This currently with reactor leads to a lot of code like: teacherrecord.getPerson().getName() studentrecord.getPerson().getAdress() Suggestion: When there is a one-to-one relation between two tables i.e. teacher <hasone person>, make it possible to access all methods of the person-record directly from a teacherobject. Perhaps: <object teacher> <extends person /> </object> Or some such, would make it possible to directly do: teacherrecord.getName() (where name is a field defined on person, not on teacher) If the teacherrecord *DOES* have a name-field, this should offcourse override the one in the person-record as elsewhere with inheritance. Eivind Kjørstad -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Reactor for ColdFusion Mailing List [email protected] Archives at: http://www.mail-archive.com/reactor%40doughughes.net/ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Reactor for ColdFusion Mailing List [email protected] Archives at: http://www.mail-archive.com/reactor%40doughughes.net/ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Reactor for ColdFusion Mailing List [email protected] Archives at: http://www.mail-archive.com/reactor%40doughughes.net/ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
