Thanks, that really helps. A few hundred more pages and you will be there. ;)
Now I just need to figure out this Unity error. Thanks again, -- Jeff -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Doug Hughes Sent: Sunday, June 25, 2006 7:00 AM To: [email protected] Subject: RE: [Reactor for CF] Basic Object Relationship Issue Jeff - Here's the documentation I wrote on the field tag last night. (It's not checked in yet.) <field> tag The field tag defines details of a specific field in your database object. The tag can be to either assign an alias to a field. On DBMS which use sequences instead of identity or auto increment columns the field tag can also be used to specify the sequence to get new value from when writing records into the database. Every field of a database object is used to generate getter and setter methods on record objects. They're also used in several other places in the framework. However, many databases have naming conventions for fields (or tables) which don't translate nicely into names for these methods. For example, a column named str_user_name would, by default generate the methods getStr_user_name() and setStr_user_name(). Methods with name like these are not just unsightly and hard to type (you try it!), they don't really do a good job of describing what they're returning. Yes, I know that "Str" probably stands for "string", but would you name a method that adds two numbers and returns the value intAdd()? Maybe, but more likely you'd name it add(). To work around these generated method names you can specify an alias. For example: <object name="User"> <field name="str_user_name" alias="username" /> </object> This would configure Reactor to generate methods named getUsername() and setUsername(). Attributes Attribute Required Description name Yes The name of the field in the database. alias No The alias to assign to the field. If this is not provided it is defaulted to the value of the name attribute. Sequence No The name of a sequence to use to get the next value for this field from. This is useful only for databases which use sequences instead of identity or auto-incrementing values such as Oracle and PosgreSQL. Child Tags None Example <reactor> <objects> <object name="User"> <field name="uid" alias="userId" /> </object> </objects> </reactor> Doug -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jeff Chastain Sent: Saturday, June 24, 2006 10:53 PM To: [email protected] Subject: RE: [Reactor for CF] Basic Object Relationship Issue You are correct. Once I moved this same config xml into its own reactor only test area it appears to work fine. One more basic question ... in looking through the example reactor.xml files, I am seeing <field tags. What are these and what do they do? <object name="User"> <field name="userId" sequence="User_userId" /> </object> Thanks for the help. -- Jeff -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Doug Hughes Sent: Saturday, June 24, 2006 9:22 PM To: [email protected] Subject: RE: [Reactor for CF] Basic Object Relationship Issue This sounds like a unity problem. I'd try the MG list. Honestly, I've yet to use MG unity so I can't say. Have you tried breaking this out of MG into a test file? Doug -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jeff Chastain Sent: Saturday, June 24, 2006 9:46 PM To: [email protected] Subject: RE: [Reactor for CF] Basic Object Relationship Issue Okay, that makes sense. I made those changes and now get a new error message ... ReactorAdapter: Unable to establish metadata for "hasOne" "contactaddress" relationship for "contact". I checked the database and all of the "names" match the database table and field names, so this does not appear to be a naming issue. I am using MySQL 5 and I even checked that the case for all of the table and field names matches the xml config as well. So, what does this error message really mean? Thanks -- Jeff -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Doug Hughes Sent: Saturday, June 24, 2006 8:16 PM To: [email protected] Subject: RE: [Reactor for CF] Basic Object Relationship Issue I haven't had time to review the parent email, but I can say that sean's wrong here. The linking object needs to have a hasOne relationship to the two objects that are being linked. The two objects being linked need hasMany relationships to the linked object with the link tag specifying the linking object. IE: <object name="User> <hasMany name="Address"> <link name="UserAddress" /> </hasMany> </object> <object name="UserAddress"> <hasOne name="User"> <relate from="userId" to=" userId " /> </hasOne> <hasOne name="Address"> <relate from="addressId" to="addressId" /> </hasOne> </object> <object name=" Address "> <hasMany name="User"> <link name="UserAddress" /> </hasMany> </object> Doug -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sean Corfield Sent: Saturday, June 24, 2006 8:56 PM To: [email protected] Subject: Re: [Reactor for CF] Basic Object Relationship Issue On 6/24/06, Jeff Chastain <[EMAIL PROTECTED]> wrote: > I have a simple db with 5 tables ... contact, address, state, country, > and contactAddress. The contact can have one or more addresses and > vice versa (hence the linking table contactAddress). The address then > has a state and > a country. So what have I missed here ... I think the <link> tag needs a <relate> child to specify which columns key in/out of the link table. > <hasMany name="address"> > <link name="contactAddress" /> ... need <relate> tag here? ... > </hasMany> -- Sean A Corfield -- http://corfield.org/ Got frameworks? "If you're not annoying somebody, you're not really alive." -- Margaret Atwood -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 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/ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 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/ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Reactor for ColdFusion Mailing List [email protected] Archives at: http://www.mail-archive.com/reactor%40doughughes.net/ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
