Silly me, I can force it to work by added the 3rd entity as I bogged
about, but not using fkcolumn="scapeID,accID"
property name="Accounts" singularname="Account" fieldtype="many-to-
many"
cfc="pAccount" fkcolumn="scapeID,accID" inversejoincolumn="accID"
linktable="pLinkScapesAccount";
I added the column="scapeId,accId" but Hibernate gives an error I
recall "Foreign key must have same number of columns as the referenced
primary key" I found some interesting reads related to this:
http://www.coderbag.com/NHibernate/Foreign-key-must-have-same-number-of-columns-as-the-referenced-primary-key
This seems so straight forward I don't understand why I am having so
much of an issue, my heads not in the right place today.
here are my 2 entities before the change, still not resolved using the
FK without me having to create the link table as an entity.
Scape.cfc
component displayname="Scape Entity" entityname="pScape"
persistent="true" extends="baseEntity" accessors=true {
// Persistant Properties
property name="scapeID" length="100" type="string"
ormtype="string" fieldtype="id" generator="guid";
property name="scapeName" length="35" type="string"
ormtype="string" notnull="true" persistent=true default=""
// non persistent values
// Related Object Properties
property name="Accounts" singularname="Account" fieldtype="many-to-
many" cfc="pAccount" fkcolumn="scapeID,accID"
inversejoincolumn="accID" linktable="pLinkScapesAccount";
Account.cfc
component displayname="Account Entity" output="false" hint="I am the
core account object object. Other sub-classes will extend me to define
specific types of accounts."
persistent="true" discriminatorcolumn="accountType"
extends="baseEntity" table="pAccount" {
// Persistant Properties
property name="accID" length="100" type="string"
ormtype="string" fieldtype="id" generator="guid";
property name="accFName" length="35" type="string"
ormtype="string" notnull="true" persistent=true default=""
hint="";
// Related Object Properties
property name="Scapes" singularname="Scape" fieldtype="many-to-many"
cfc="pScape" fkcolumn="accID" inversejoincolumn="scapeID"
linktable="pLinkScapesAccount";
On Aug 11, 11:40 am, Andrew Scott <
andr...@andyscott.id.au> wrote:
> Yeah it is one of those things if you;re not doing it often enough, its very
> easy to forget. I had troubles with an ORM issues just recently with another
> friend and although I had half the relationships working I was stumped on
> the other half of it.
>
> And when you get to a point of well it should be working sometimes the
> obvious goers out the window.
>
> Mind you we still haven't solved this issue, as what should work actually
> doesn't. But I am sure it is something that we both are over looking.
>
>
>
>
>
>
>
> On Thu, Aug 11, 2011 at 8:16 PM, Sparky <
cfspa...@gmail.com> wrote:
> > Sometimes I surprise myself with just how stupid I can be.....
>
> > In a blog post I made sometime back I had this same issue. See here:
>
> >
http://www.cfcoffee.co.uk/index.cfm/2010/9/20/Head-Spin-Moment-ORM-ma...