You're missing the <objects> tag which should surround all the <object>
tags
This is an error in the reactor documentation at
http://livedocs.reactorframework.com/Configuring_Relationships_in_Reacto
r.htm
The 3rd XML block on that page should read as follows
<reactor>
<config>
<project value="Scratch" />
<dsn value="Scratch" />
<type value="mssql" />
<mapping value="/ScratchData" />
<mode value="development" />
</config>
<objects>
<object name="Customer">
<hasOne name="Address">
<relate from="addressId" to="addressId" />
</hasOne>
</object>
</objects>
</reactor>
Cheers, Chris
________________________________
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Seb Duggan
Sent: 15 January 2007 17:08
To: [email protected]
Subject: [Reactor for CF] Relationship problems...
I've just started tinkering with Reactor today, and like what
I've seen so far...
However, I've had a problem with database relationships. I'm
working through the tutorial (latest version, at
livedocs.reactorframework.com), against build 4.08.
All works well on single table queries; but when I try a
relationship, it falls down.
The tables are defined as specified in the tutorial (on MS SQL
2000). My config file is as follows:
<reactor>
<config>
<project value="Scratch" />
<dsn value="Scratch" />
<type value="mssql" />
<mapping value="/ScratchData" />
<mode value="development" />
</config>
<object name="Customer">
<hasOne name="Address">
<relate from="addressId" to="addressId" />
</hasOne>
</object>
</reactor>
and I am using the following code to test it:
<!--- create the reactorFactory --->
<cfset Reactor = CreateObject("Component",
"reactor.reactorFactory").init(expandPath("reactor.xml")) />
<!--- create a customerRecord --->
<cfset CustomerRecord = Reactor.createRecord("Customer") />
<cfdump var="#CustomerRecord#">
But the resulting component dump doesn't include the getAddress
or setAddress methods.
Any ideas?
Seb
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- --
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/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --