Chris, thanks for looking into this.

You're right on the point that I did incorrectly link EVENT_ROLE in
the hasMany reference (problem TWO). Simeon gave me some guidance
there last week and along with your suggestion, I will fix that as
soon as I get past this alias issue. For now, I have removed it all
from my project.

In your reference to problems ONE I'm still receiving the same error message.

I believe this problem is at a more fundamental level. Not only can I
not use an object with an alias, I can't reference/open it from the
reactor factory.

In order to demonstrate this I decided to start from scratch with a
barebones implementation; Reactor and 1 CFM file with no object
relationships. Just in case you would like to test locally, I'll
attach the two files that use the Reactor core and the SQL database.

Here is what I did.

1.      Download new reactor files from doughughes.net
2.      Put new files web root
3.      Made new folder in root called ReactorAliasTest
4.      Put blank application file in the new folder
5.      Created/populated Reactor.xml and put it in the new folder
6.      Created test.cfm to test the code with
7.      Created new database called ReactorAliasTest
8.      Created a table called ISSUES with one Identity column (pk) and one
text column.
9.      Created ColdFusion DSN for the new database.
10.     In test.cfm, instantiated the reactor factory
11.     In test.cfm I attempted to open the ISSUES object by alias and it 
failed.

Object in Reactor.xml:

        <objects>

        <object name="ISSUES" alias="TEST">
                <field name="ISSUE_DESC" alias="Description" />
        </object>
                
        </objects>


Here is test.cfm.

<cfset variables.reactor =
createobject('component','reactor.reactorFactory').init(expandPath(".")
& "/reactor.xml") />

<cfset test1 = variables.reactor.createRecord('ISSUES') />

Actual:<cfdump var="#test1.getIssue_ID()#" />    <!---   THIS WORKS  ----->

<cfflush /><hr>

<cfset test2 = variables.reactor.createRecord('TEST') />    <!---  
THIS FAILS----->

Alias:<cfdump var="#test2.getIssue_ID()#" />


In tracing the objects calls back to the stored procedure that is
called when the reactor factory is called upon, Reactor is submitting
the alias to the database server instead of translating it to the
table name that the DBMS would recognize.

Please let me know what you think about this.

Again, thanks for your help.


On 4/14/06, Chris Phillips <[EMAIL PROTECTED]> wrote:
> I'll take a stab:
>
> I see two problems, one technical and one conceptual.
>
> ONE.
> I think that aliases have to be used throughout your code including the xml.
> So, if you alias "EVENTS" as "TEST" then your "EVENT_ROLL" object definition
> should say it hasOne "TEST".
> **Will someone chime in and verify/deny this.
>
> TWO.
> It seems awfully strange to me that you would say that an EVENT hasMany
> EVENT_ROLEs and then use the "link" verb and specify the link table as the
> table that you are linking to.
> What I mean is EVENT_ROLE links an EVENT and a ROLE.
> So, it would make more sense to have this code below.
> <object name="EVENTS">
>     <hasMany name="ROLES">
>          <link name="EVENT_ROLE" />
>
>     </hasMany>
>     <hasMany name="EVENT_ROLE">
>         <relate from="EVENT_SK" to="EVENT_SK" />
>     </hasMany>
> </object>
>
> I hope this helps. Let us know...
>
>
> On 4/14/06, Brian Billings <[EMAIL PROTECTED]> wrote:
> > Thanks for the insight Brian. I do understand that Reactor is still in
> > development. But, like you say, I see many posts using the alias and
> > none of them seem to be having an issue with it.
> >
> > I personally feel the post I sent a few weeks ago was pretty straight
> > forward. I'll repost if below and I would love some one could help.
> >
> > As I sense a little defensiveness in your reply, please don't think
> > I'm posting with a bad attitude. I'm simply asking if you all could
> > tell me how to get help with this seemingly simple issue since posting
> > to this list isn't getting the issue resolved.
> >
> > For what it's worth, I believe there might be a bigger issue here.
> > Last night we traced the issue and the reactor core is not translating
> > the alias before it hits the stored procedure.
> >
> > This works:
> >
> >        <object name="EVENTS">
> >                <hasmany name="EVENT_ROLE">
> >                        <link name="EVENT_ROLE" />
> >                </hasmany>
> >        </object>
> >
> > <cfset test = reactor.createGateway('EVENTS') />
> >
> > This does not work (error below).
> >
> >        <object name="EVENTS" alias="TEST">
> >                <hasmany name="EVENT_ROLE">
> >                        <link name="EVENT_ROLE" />
> >                </hasmany>
> >        </object>
> >
> > <cfset test = reactor.createGateway ('TEST') />
> >
> > What am I doing wrong?
> >
> >
> > On 4/14/06, Brian Kotek <[EMAIL PROTECTED]> wrote:
> > > If it's causing you this much of a problem you may want to hold off on
> using
> > > Reactor for this project. It is still a piece of beta software and
> everyone
> > > here working on it or participating in the forums also has other
> > > responsibilities. It's one thing to ask a relatively straighforward
> > > question, it's quite another to post dozens of lines of XML and an ER
> > > diagram and ask what's wrong. For what its worth, I've used Reactor with
> the
> > > alias and haven't had any problems.
> > >
> > > One thing that may help would be if you could post the most simple
> example
> > > you can create that demonstrates the problem.
> > >
> > > Regards,
> > >
> > > Brian
> > >
> > >
> > >
> > > On 4/14/06, Brian Billings <[EMAIL PROTECTED] > wrote:
> > > >
> > > All,
> > >
> > > Questions on my questions. Are we asking the wrong question or not
> > > providing enough info?
> > >
> > > We have been having the issue for over a month and posted 6 or 7
> > > different posts and for what ever reason cannot get any help with it.
> > >
> > > For ahile we could just not use the alias but we are to the point that
> > > we have to have them to go forward and this issue with Reactor is hold
> > > us back.
> > >
> > > Is there something more we can do to get help with this?
> > >
> > >
> > >
> > > On 4/10/06, Brian Billings <[EMAIL PROTECTED] > wrote:
> > > > Simeon and all,
> > > > When I changed the XLM to what you provided and i'm getting this error
> > > > when I run the code below:
> > > >
> > > > <cfset local.gateway = variables.reactor.createGateway("ROLES") />
> > > >
> > > > First Attempt:
> > > > <cfset local.query =
> > > > local.gateway.createQuery
> > >
> ().join('ROLES','EVENT_ROLE','ER_').join('EVENT_ROLE','EVENTS','E_')
> > > > />
> > > >
> > > > I also tried this and got a similar message:
> > > > <cfset local.query =
> > > local.gateway.createQuery().join('ROLES','EVENTS','E_') />
> > > >
> > > > Message Relationship Does Not Exist
> > > > Detail The object 'EVENT_ROLE' does have have a relationship with an
> > > > alias of 'EVENTS'.
> > > > Extended Info
> > > > Tag Context F:\MARC\Reactor\base\abstractMetadata.cfc
> > > (167)
> > > >
> > > >
> > > > Here is what is in my file.
> > > >
> > > > <object name="EVENTS">
> > > >    <hasmany name="ROLES">
> > > >
> > > >        <link name="EVENT_ROLE" />
> > > >    </hasmany>
> > > > </object>
> > > >
> > > > <object name="ROLES">
> > > >    <hasmany name="EVENTS">
> > > >
> > > >        <link name="EVENT_ROLE" />
> > > >    </hasmany>
> > > > </object>
> > > > <object name="EVENT_ROLE">
> > > >    <hasone name="EVENTS">
> > > >        <relate from="EVENT_SK" to="EVENT_SK" />
> > > >    </hasone>
> > > >    <hasone name="ROLES">
> > > >
> > > >        <relate from="ROLE_SK" to="ROLE_SK" />
> > > >    </hasone>
> > > > </object>
> > > >
> > > >
> > > > Thanks for your help.
> > > >
> > > > On 4/10/06, Simeon Bateman <[EMAIL PROTECTED]> wrote:
> > > > >
> > > > > Ignore that code in the other post.  Gmail sent too early :)
> > > > >
> > > > > Here is what I think that config would look like:
> > > > >
> > > > > <object name="EVENTS">
> > > > >     <hasmany name="ROLES">
> > > > >
> > > > >         <link name="EVENT_ROLE" />
> > > > >     </hasmany>
> > > > > </object>
> > > > >
> > > > > <object name="ROLES">
> > > > >     <hasmany name="EVENTS">
> > > > >
> > > > >         <link name="EVENT_ROLE" />
> > > > >     </hasmany>
> > > > > </object>
> > > > > <object name="EVENT_ROLE">
> > > > >     <hasone name="EVENTS">
> > > > >         <relate from="EVENT_SK" to="EVENT_SK" />
> > > > >     </hasone>
> > > > >     <hasone name="ROLES">
> > > > >
> > > > >         <relate from="ROLE_SK" to="ROLE_SK" />
> > > > >     </hasone>
> > > > > </object>
> > > > >
> > > > >
> > > > > Let me know if that makes sense.  EVENTS haveMany ROLES; ROLES
> haveMany
> > > EVENTS; and the to are linked by the EVENT_ROLE object.
> > > > >
> > > > > sim
> > > > >
> > > > >
> > > > >
> > > > > On 4/9/06, Simeon Bateman <[EMAIL PROTECTED]> wrote:
> > > > > >
> > > > > > Looking at this closer here is what I would expect to see.  It
> appears
> > > that the EVENTS object need to have a "hasMany" relations ship with
> ROLES.
> > > and then you would link those via teh Event_ROLE table.  I would expect
> the
> > > confif for that to look like this.
> > > > > >
> > > > > >
> > > > > >   <object name="EVENTS">
> > > > > >
> > > > > >             <hasmany name="EVENT_ROLE">
> > > > > >
> > > > > >                   <link name="EVENT_ROLE" />
> > > > > >
> > > > > >             </hasmany>
> > > > > >
> > > > > >       </object>
> > > > > >
> > > > > >
> > > > > >  <object name="ROLE">
> > > > > >
> > > > > >    <hasMany name="EVENTS">
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > </object>
> > > > > >
> > > > > >
> > > > > >           <object name="EVENT_ROLE">
> > > > > >
> > > > > >                   <hasone name="EVENTS">
> > > > > >
> > > > > >                         <relate from="EVENT_SK" to="EVENT_SK" />
> > > > > >
> > > > > >                   </hasone>
> > > > > >
> > > > > >                   <hasone name="ROLES">
> > > > > >
> > > > > >                         <link name="ROLES" />
> > > > > >
> > > > > >                   </hasone>
> > > > > >
> > > > > >             </object>
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > On 4/8/06, Brian Billings < [EMAIL PROTECTED]> wrote:
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Yesterday I submitted a post about the problem I am having with
> the
> > > alias in the reactor config file (which is still unresolved) and I
> believe
> > > it was Simeon that brought up a possible issue with the way I am linking
> > > objects in the cofig file.
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > I have had a very hard time wrapping my head around how the
> config
> > > file works and I honestly still don't understand it completely. My code
> runs
> > > with all of the intricate joins so I don't think it is totally wrong.
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > I have attached a gif of my database tables and the Reactor
> file. I
> > > don't have all of the objects mapped yet (im basically mapping the
> > > relationships as I need them).
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Before I go forward I would like to be sure that am I doing this
> > > right? Like I mentioned, it works.
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Summary of what I am doing:
> > > > > > >
> > > > > > > -Roles are defined (ROLES)
> > > > > > >
> > > > > > > -Applications are defined (APPLICATIONS)
> > > > > > >
> > > > > > > -Applications have events (APPLICATION_EVENT)
> > > > > > >
> > > > > > > -Events are assigned roles (EVENT_ROLE)
> > > > > > >
> > > > > > > -User are assigned roles via direct mapping (USER_ROLE) or via
> group
> > > (GROUPS, GROUP_ROLE & GROUP_USER)
> > > > > > >
> > > > > > > -User must have one or more roles assigned to the event to see
> the
> > > event
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > <reactor>
> > > > > > >
> > > > > > >       <config>
> > > > > > >
> > > > > > >             <project value="MARC" />
> > > > > > >
> > > > > > >             <dsn value="MARC" />
> > > > > > >
> > > > > > >             <type value="mssql" />
> > > > > > >
> > > > > > >             <mapping value="/core/model/Reactor" />
> > > > > > >
> > > > > > >             <mode value="always" />
> > > > > > >
> > > > > > >       </config>
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >       <objects>
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >       <object name="EVENTS">
> > > > > > >
> > > > > > >             <hasmany name="EVENT_ROLE">
> > > > > > >
> > > > > > >                   <link name="EVENT_ROLE" />
> > > > > > >
> > > > > > >             </hasmany>
> > > > > > >
> > > > > > >       </object>
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >           <object name="EVENT_ROLE">
> > > > > > >
> > > > > > >                   <hasone name="EVENTS">
> > > > > > >
> > > > > > >                         <relate from="EVENT_SK" to="EVENT_SK" />
> > > > > > >
> > > > > > >                   </hasone>
> > > > > > >
> > > > > > >                   <hasone name="ROLES">
> > > > > > >
> > > > > > >                         <link name="ROLES" />
> > > > > > >
> > > > > > >                   </hasone>
> > > > > > >
> > > > > > >             </object>
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >             <object name="GROUP_ROLE">
> > > > > > >
> > > > > > >                   <hasone name="GROUPS">
> > > > > > >
> > > > > > >                         <relate from="GROUP_SK" to="GROUP_SK" />
> > > > > > >
> > > > > > >                   </hasone>
> > > > > > >
> > > > > > >                   <hasone name="ROLES">
> > > > > > >
> > > > > > >                         <link name="ROLES" />
> > > > > > >
> > > > > > >                   </hasone>
> > > > > > >
> > > > > > >             </object>
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >             <object name="GROUPS">
> > > > > > >
> > > > > > >                   <hasmany name="GROUP_ROLE">
> > > > > > >
> > > > > > >                               <link name="GROUP_ROLE" />
> > > > > > >
> > > > > > >                   </hasmany>
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >             </object>
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >             <object name="USER_ROLE">
> > > > > > >
> > > > > > >                   <hasone name="USERS">
> > > > > > >
> > > > > > >                         <relate from="USER_SK" to="USER_SK" />
> > > > > > >
> > > > > > >                   </hasone>
> > > > > > >
> > > > > > >                   <hasone name="ROLES">
> > > > > > >
> > > > > > >                         <relate from="ROLE_SK" to="ROLE_SK" />
> > > > > > >
> > > > > > >                   </hasone>
> > > > > > >
> > > > > > >             </object>
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >             <object name="ROLES">
> > > > > > >
> > > > > > >                   <hasMany name="GROUP_ROLE">
> > > > > > >
> > > > > > >                         <relate from="ROLE_SK" to="ROLE_SK" />
> > > > > > >
> > > > > > >                   </hasMany>
> > > > > > >
> > > > > > >                   <hasMany name="EVENT_ROLE">
> > > > > > >
> > > > > > >                         <relate from="ROLE_SK" to="ROLE_SK" />
> > > > > > >
> > > > > > >                   </hasMany>
> > > > > > >
> > > > > > >                   <hasMany name="USER_ROLE">
> > > > > > >
> > > > > > >                         <relate from="ROLE_SK" to="ROLE_SK" />
> > > > > > >
> > > > > > >                   </hasMany>
> > > > > > >
> > > > > > >             </object>
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >             <object name="USERS">
> > > > > > >
> > > > > > >                   <hasMany name="USER_ROLE">
> > > > > > >
> > > > > > >                         <relate from="USER_SK" to="USER_SK" />
> > > > > > >
> > > > > > >                   </hasMany>
> > > > > > >
> > > > > > >                   <hasMany name="GROUP_USER">
> > > > > > >
> > > > > > >                         <relate from="USER_SK" to="USER_SK" />
> > > > > > >
> > > > > > >                   </hasMany>
> > > > > > >
> > > > > > >             </object>
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >             <object name="GROUP_USER">
> > > > > > >
> > > > > > >                   <hasOne name="GROUPS">
> > > > > > >
> > > > > > >                         <relate from="GROUP_SK" to="GROUP_SK" />
> > > > > > >
> > > > > > >                   </hasOne>
> > > > > > >
> > > > > > >             </object>
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >       </objects>
> > > > > > >
> > > > > > > </reactor>
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > >
> > >
> > >
> > > -- 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/
> >
> >
> >
> > -- Reactor for ColdFusion Mailing List -- [email protected]
> > -- Archives at
> http://www.mail-archive.com/reactor%40doughughes.net/
> >
> >
> >
>
>
>
> --
> Chris Phillips
> www.dealerpeak.com
> Senior Application Developer -- 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/


Reply via email to