What are your thoughts on making Transfer compatible with Railo? I
have been testing Railo 2.0 and find that the speed of Railo is simply
amazing over ColdFusion.
The only problem is that my favorite ORM (Transfer, of course) won't
work on Railo! Reactor does work correctly, but I really took a liking
to Transfer in my last project.
Thanks,
Terry Schmitt
:oD
Mark
Transfer.xml
<package name="story">
<object name="story" table="stories">
<id name="id" type="numeric" /> <--- I set the ID to
the column id in the table
<property name="id" type="numeric" column="id"/>
<----do I need this too?
<property name="user" type="string" column="user"/>
<property name="restaurant" type="string"
column="restaurant"/>
<property name="title" type="string"
column="title"/>
<property name="body" type="string" column="body"/>
<property name="date" type="date" column="date"/>
<property name="cat" type="numeric" column="cat"/>
<onetoone name="cat">
<link column="cat" to="category.id"/>
</onetoone>
<manytoone name="comments">
<link column="id" to="comments.storyid"/>
<collection type="array">
<order property="date"/>
</collection>
</manytoone>
<onetoone name="user">
<link column="user" to="user.username"/>
</onetoone>
</object>
</package>
Wally Kolcz escreveu:
> When declaring a object you need to determine the ID, which I assume is the
> primary key,
Yes.
> do you then also need to declare it as a property too?
>
No, you declare the column (id, property or a relationship) only once.
In your example you´ll need to remove the properties id, user and cat.
collection type is avaliable for onetomany and manytomany relationships,
not for manytoone's.
In the manytoone relationship you won´t use the id column.
You´ll need to create a FK to the parent table.
Ronan
Sorry Scott, I posted them both at the same time to make sure I could get the answer. Wasn’t sure if the MG newsgroup was the right place to post it.
For future reference, it's often considered bad 'net-iquette' to cross
post like that.
Glad to see you got your issue resolved,
Mark
On 7/17/07, Wally Kolcz <wko...@isavepets.com> wrote:
>
>
>
>
> Sorry Scott, I posted them both at the same time to make sure I could get
> the answer. Wasn't sure if the MG newsgroup was the right place to post it.
> >
>
Oh I think we may have mercy, but you never know ;)
Mark