Hi,

Like many, I am just beginning to explore Reactor. And  one of the most basic functions is not returning what I expect. (Indeed, it doesn't seem to run.) I'd appreciate it if someone could point out my error.

The Reactor.xml file has the following object definitions:

<objects>
        <object name="tblLPWebDocs_Documents" alias="Document" >
            <hasOne name="Category">
                <relate from="document_i_category_id" to="category_i_id" />
            </hasOne>
        </object>
        <object name="tblLPWebDocs_Categories" alias="Category" >
            <hasMany name="Document">
                <relate from="category_i_id" to="document_i_category_id" />
            </hasMany>       
        </object>
    </objects>

The code within a test page has the following:

<cfset Reactor = CreateObject("Component","reactor.reactorFactory").init("../config/Reactor.xml") />
<cfset DocumentGateway = reactor.createGateway("Document") />
<cfset Docs = DocumentGateway.getAll()>
<cfset DocumentRecord = Reactor.createRecord("Document") />
<cfset DocumentRecord.setDocument_i_id(1)>
<cfset DocumentRecord.load()>
<html>
    <head>
    <Title>Test</Title></head>
    <body><cfdump var="#Docs#"><br />
    <cfoutput >
    #DocumentRecord.getDocument_i_id()#<br />
    #DocumentRecord.getDocument_v_title()#<br />
    #DocumentRecord.getDocument_v_description()#<br />
    #DocumentRecord.getDocument_d_changeDate()#<br />
    </cfoutput>

The problem is this: the objects are created successfully. And by dumping the results of Document.Gateway.getAll(), I confirm that a single record exists in the table, with an ID of 1.

However, after creating a Document Record and setting the ID value, the load() method does not seem to run. By that I mean, the output of the record object shows that the field values have not populated the Record object. And the CF debugging output does not show that any query has run to read the record from the table.

I'm using the latest BER of Reactor from the repository.


--
Thanks,

Tom

Tom McNeer
MediumCool
http://www.mediumcool.com
530 Means St NW, Suite 110
Atlanta, GA 30318
404.589.0560 -- Reactor for ColdFusion Mailing List -- [email protected] -- Archives at http://www.mail-archive.com/reactor%40doughughes.net/

Reply via email to