For some reason, I having a problem with creating hasOne
relationships.
In reactor.xml:
<object name="tblParticipant">
<hasOne name="tblAccelerometer">
<relate from="ID" to="ID" />
</hasOne>
</object>
When I try:
<cfset participantRecord = createRecord('tblParticipant').load(ID=1) /
>
<cfset accRecord = participantRecord.gettblAccelerometer() />
I get the following:
Message The method gettblAccelerometer was not found in component D:
\Inetpub\wwwroot\Ladies\model\data\Record
\tblParticipantRecordmssql.cfc.
Sure enough, when looking in the project file, it is not creating the
gettblAccelerometer method.
Any ideas? I haven't had this problem before.
Byron
--
You received this message because you are subscribed to the Google Groups "Reactor" group.
To post to this group, send email to reacto...@googlegroups.com.
To unsubscribe from this group, send email to reactor-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/reactor-users?hl=en.
Thanks for the response.
I specified the object and it did not work. I tried the reverse also
and in both cases, the relationship was not created.
byron
On Jan 30, 6:15 pm, Pete Kucera <cfapp...@gmail.com> wrote:
> Byron,
>
> I'm shooting from the hip here, but I seem to remember having the same issue
> and realized that I did not have the other table object defined. Is your
> tblAccelerometer defined in the reactor xml?
>
> <object name="tblAccelerometer" /> will work if it doesn't have
> relationships of its own.
>
> Good Luck.
>
> Pete Kucera
>
> > reactor-user...@googlegroups.com<reactor-users%2Bunsu...@googlegroups.com>
Do you have the foreign key for tblAccelerometer set on tblParticipant?
That's all I got.
:den
--
Thinking has become a superfluous exercise... purely internal, without
compelling force, more or less a game.
Jacques Ellul
For tblAccelerometer, I have Pt_ID as a primary key, for
tblParticipant, I have ID and Pt_ID as primary keys. I've also tried
it without Pt_ID as a primary key in tblParticipant. Below is the
component.
hierarchy: WEB-INF.cftags.component
reactor.base.abstractRecord
reactor.project.Ladies.Record.tblParticipantRecord
path: D:\Inetpub\wwwroot\reactor\project\Ladies\Record
\tblParticipantRecord.cfc
properties:
methods: _getDao*, _getInitialTo*, _getTo, _setDao*, _setInitialTo*,
_setTo, exists, getAddress1, getAddress2, getBestTimeToContact,
getCity, getEmail, getFirstname, getID, getLastname, getMI,
getPhoneDay, getPhoneEvening, getPhoneOther, getPt_ID, getSiteID,
getState, getStatus, getSubStudy, getZipcode, init, setAddress1,
setAddress2, setBestTimeToContact, setCity, setEmail, setFirstname,
setID, setLastname, setMI, setPhoneDay, setPhoneEvening,
setPhoneOther, setPt_ID, setSiteID, setState, setStatus, setSubStudy,
setZipcode
inherited methods: _configure, _getDictionary, _getErrorCollection,
_getObjectMetadata, _getParent, _setParent, clean, delete, dump,
hasErrors, hasParent, isDeleted, isDirty, load, populate, resetParent,
save, validate, validated
Am I messing up the keys??
byron
> Am I messing up the keys??
None of those are foreign keys? Shouldn't Pt_ID be a foreign key in
tblAccelerometer, if it's the primary key in tblParticipant?
I'm not sure of your specific schema, but there should be foreign
keys. And I don't remember if composite primary keys are handled well
or not...
:Den
--
The nature of God is a circle of which the center is everywhere and
the circumference is nowhere.
Empedocles
byron
Forgot the <reactor> node in the %&%&^% reactor.xml file. Shoot me
now.
Thanks for the help.
Done that myself before, no problemo!
:den
--
Everything must justify its existence before the judgment seat of
Reason, or give up existence.
Friedrich Engels
****************************************************
This email is sent for and on behalf of Halliwells LLP.
Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB. A list of members is available for inspection at the registered office together with a list of those non members who are referred to as partners. We use the word “partner” to refer to a member of the LLP, or an employee or consultant with equivalent standing and qualifications. Regulated by the Solicitors Regulation Authority.
CONFIDENTIALITY
This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 2500.
For more information about Halliwells LLP visit www.Halliwells.com.