Then I'm having trouble for sure because I cannot access it by the alias when invoking the createRecord method. When I use the alias, it throws an error because it never translate the alias in the Reactor core before hitting the database.

 
Thanks
- Doug
 
On 4/13/06, Brian Kotek <[EMAIL PROTECTED]> wrote:
As I understand it, if you define an alias in the Reactor XML file, you would always use that alias to reference that table. For all intends and purposes, from your side of things the alias IS the table name.

On 4/13/06, Doug Arthur < [EMAIL PROTECTED]> wrote:
Ok, maybe I need a better understanding.
 
When and where is it appropriate to reference the alias rather than the actual table name? Maybe that's my whole problem.
 
I noticed that when createRecord is executed, the objectFactory goes out to the database before generating the object by calling the generateObject method on the objectTranslator. Where the objectTranslator in turn calls the getXml method on the object.cfc in the generateObject method, which is where the aliasing comes into play from what I can tell...
 
Andy advise and help I can get here will be great. Thanks in advanced!
 
- Doug

 
On 4/13/06, Doug Arthur <[EMAIL PROTECTED] > wrote:
I'm new to reactor and am having a small bit of trouble. Straight out of the box I'm unable to get an alias to work at all. Below is my code, and any help would be greatly appreciated.
 
I have my Reactor mode set to always and my modelglue reload set to true. I just can't seem to figure this simple piece out.
 
<reactor>
    <config>
        <project value="TestProject">
        <dsn value="TestAppOne" />
        <type value="mssql" />
        <mapping value="/model/reactor" />
        <mode value="always" />
    </config>
 
    <objects>
        <object name="tbl_users" alias="User">
            <field name="user_sk" alias="UserID">
        </object>
    </objects>
</reactor>
 
<!--- Code to instantiate reactor and create a record --->
<cfset variables.reactor = CreateObject("Component","reactor.reactorFactory").init(expandPath("/core/config/reactor.xml")) />
<cfset test = variables.reactor.createRecord('User')>
 
 
I get the following error
 

Invalid Object Type

The Type argument must be one of: table, view

 
 
 
 
 
I've done some research into the Reactor blackbox core files and this is what I'm finding is going on:
 
When passing in the alias to the createRecord method, the value never gets converted to the actual table name when the sp_tables procedure gets called in the /reactore/data/mssql/ObjectDoa.cfc object.
  <cfstoredproc datasource="#getDsn()#" procedure="sp_tables" username="#getUsername()#" password="#getPassword()#">
   <cfprocparam cfsqltype="cf_sql_varchar" scale="384" value=" #arguments.Object.getName()#" /> <---------------------------------- HERE THE arguments.Object.getName () is still "User" rather than the actual table name of "tbl_users".
   <cfprocresult name="qObject" />
  </cfstoredproc>
 
 
 

-- 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/

Reply via email to