Now, first off, wouldn't a person have many Users? And a User would haveOne
Person?
I'd try this:
<object name="Person">
<hasMany name="User">
<relate from="ID" to="PersonID" />
</hasMany >
</object>
But honestly, this shouldn't make a difference. There must be something
simple that's going wrong here. Like the personID is really in the person
table? It maybe it's crossing the two generic "ID" columns.
Any chance you can do this: Go into the abstractGateway.cfc and throw a
cfabort right before the </cfquery> this should cause the query to be
output. I'd love to know if there's anything weird about this.
Doug
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Cody
Caughlan
Sent: Monday, February 20, 2006 8:20 PM
To: [email protected]
Subject: [Reactor For CF] [Spam] Mapping question
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/
-- Reactor for ColdFusion Mailing List -- [email protected]
-- Archives at http://www.mail-archive.com/reactor%40doughughes.net/