Sure,
But if you get ORM to create the mapping files for you,
Then you can edit the HBMXML file directly.

If you go down this path;
You do get greater control and and you can use non-cfml texts for
creating your mappings.
This is what we did.

Which doesn't, of course, make it right for you...
just a possibility.

Just off the top of my head ...
I am pretty sure there is a mappedColumn / mappedByColumn atribute (or
similar) in CF-ORM properties.
Perhaps the CF docs can help you with that?
We might find that the attribute is actually the CF nice way of
specifiying the KEY element in an XML file?


Gavin.
On May 19, 5:23 pm, "Steve Onnis" <st...@cfcentral.com.au> wrote:
> Im using cfproperty
>
>
>
>
>
>
>
> -----Original Message-----
> From: Gavin Baumanis [mailto:beauecli...@gmail.com]
> Sent: Thursday, 19 May 2011 4:57 PM
> To: cfaussie
> Subject: [cfaussie] Re: ORM relationship to non id column
>
> I haven't tried it,
> But could it be this simple?
>
> <class name="Item" table="ITEM">
>     ...
>     <set name="bids" inverse="true">
>         <key column="ITEM_ID"/>
>         <one-to-many class="Bid"/>
>     </set>
> </class>
>
> That is to say, simply declare which column is the one to be joined,
> with the <key /> element?
>
> Gavin
>
> On May 19, 4:34 pm, Gavin Baumanis <beauecli...@gmail.com> wrote:
> > Hi Steve,
>
> > Am I missing something?
> > Can you not just assign a FKey declaraton and a one-to-many
> > relationship (or whatever relationship type is required)?
>
> > Or is it that the columns in question are not PK columns? and they are
> > just normal columns in the database?
> > And if this is so,
> > Is there a different column that is already designated as the Primary
> > Key?
>
> > If you have tables with no declared constraints, you can use a
> > "natural" primary key.
> > which is described in everyone's good friend , Java Peristence with
> > Hibernate section 8.1.1
>
> > "
> > Hibernate supports the use of natural keys.
>
> > If you encountered a USERS table in a legacy schema, it’s likely that
> > USERNAME is the actual primary key. In this case, you have no
> > surrogate identifier that is auto- matically generated. Instead, you
> > enable the assigned identifier generator strat- egy to indicate to
> > Hibernate that the identifier is a natural key assigned by the
> > application before the object is saved:
>
> > <class name="User" table="USERS">
> >     <id name="username" column="USERNAME" length="16">
> >         <generator class="assigned"/>
> >     </id>
> >      ...
> > </class>
> > "
>
> > I can bring the book with me, tonight to MAD, if you would like it for
> > a while.
> > All the examples are in Java, but I can follow it - and I'm not a java
> > coder by any stretch of the imagination.
>
> > Gavin.
>
> > On May 16, 2:14 pm, "Steve Onnis" <st...@cfcentral.com.au> wrote:
>
> > > I have an instance where i am trying to create a relationship between 2
> > > tables, though i am wanting to just match up values in a column in both
> > > tables. Is this possible?
>
> > > For example, i have a Content table with an ID and a UUID (yes i
> want/need
> > > both) and i have a Languages table with a related UUID and i want to
> have a
> > > orm property that joins those 2 tables up. I cant seem to get it to
> work.
>
> > > Is it even possible?
>
> > > Steve
>
> --
> You received this message because you are subscribed to the Google Groups
> "cfaussie" group.
> To post to this group, send email to cfaussie@googlegroups.com.
> To unsubscribe from this group, send email to
> cfaussie+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/cfaussie?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com.
To unsubscribe from this group, send email to 
cfaussie+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en.

Reply via email to