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.
Thanks
/Cody
-- Reactor for ColdFusion Mailing List -- [email protected]
-- Archives at http://www.mail-archive.com/reactor%40doughughes.net/