No, I think he is referring to the whole primary-key-foreign-key issue that
stumped me too. Remember, Sean how you suggested I tweak my XSL to refer to
the proper column in the getFooRecord() method??
If you search the archives for "mapping question" I think it will point you
in the right direction. Here is my original post, let me know if its the
same issue:
<orignal_post>
Hello,
This is concerning MSSQL. I have 2 tables, "Person" and "User".
Person
------
ID (int, primary key, identity)
FirstName, etc...
User
----
ID (int, primary key, identity)
PersonID (foreign key back to Person table) UserName, etc...
My reactor.xml looks like this:
<object name="Person">
<hasOne name="User">
<relate from="ID" to="PersonID" />
</hasOne>
</object>
This *doesnt* work, for some unknown reason. When I add a non-primary key
field to my Person table (I tried "UserID") and I manually populate it with
the appropriate primary key ID from the "Users" table and switch my
reactor.xml to:
<relate from="UserID" to="ID" />
it *does* work. Its almost as if, if I use a non-primary key in the "object"
XML declaration it will work, but if I specify its identity column it will
not work.
When I say it "does not" work, I mean that that when I call the
PersonRecord.getUserRecord() method, the returned UserRecord is always empty
and doesnt contain the appropriate data. Yes, I made sure the keys are
correct (correct values in the DB). Note, that I *can* read the correct data
from the PersonRecord, it just breaks down when trying to read the relevant
UserRecord.
I am sure I am doing something stupid but I have been looking at this for
quite some time to no availl.
</original_post>
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Sean Corfield
Sent: Wednesday, March 29, 2006 7:17 AM
To: [email protected]
Subject: Re: [Reactor For CF] getXyzRecord() issue
On 3/28/06, Jeff Lester <[EMAIL PROTECTED]> wrote:
> I haven't really used the getXyzRecord() method until today. The
> problem I am encountering however I feel is most likely something that I
am missing.
> When I create and load the parent record object I get all values fine.
> But when I call getXyzRecord() on the parent object the only value
> that it will return is the one it sets as specified by the relate config
file.
That is the intended behavior. If you have a Person and a Person hasOne
Address, then once you have loaded a given Person you can call
getAddressRecord() on that Person object to get its (one) Address object.
Is that not what you expect? If not, show us your XML and your code.
--
Sean A Corfield -- http://corfield.org/
Got frameworks?
"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood
-- 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/