I will try. Was a bit afraid because the Index page of Cayenne says "3.0 (in 
development)"

I wanted to do something like  this

select m.*, s.subscription_type from magazines m, subscriptions s where 
m.mag_id = s.mag_id and s.reader_id = <readerID>;

The returned result set would be stored in List<Magazine>

Is something like this doable?

One thing, I wanted to get addressed is to have foreign key in dependent table 
(explicitely in a separate column) and still have ability to ensure that 
dependent record gets deleted when master record is being deleted. Some kind of 
"on delete cascade" feature.

Thanks
Nishant

--- On Fri, 11/9/09, Aristedes Maniatis <[email protected]> wrote:

From: Aristedes Maniatis <[email protected]>
Subject: Re: Using Join Table
To: [email protected]
Date: Friday, 11 September, 2009, 4:40 AM

On 10/09/09 8:04 PM, Nishant Neeraj wrote:
> I am new to ORM and Cayenne. I a pretty puzzled by relationship flattening 
> and the way we use Modeller to achieve this.[1]

You may be confused by the different versions of Cayenne. You say you are using 
Cayenne 2, but you refer to the docs from 1.2. I would recommend that you try 
Cayenne 3 (M6) which is perfectly stable and in use in production. The modeler 
is greatly improved in that version and you might find the things you are 
trying to do clearer.

>From your description it appears to me that flattening the relationship isn't 
>the right thing for you. That is normally done when the join table has no 
>information you care about, but in this case 'subscriptions' is a table with 
>other data you need to access.

Ari Maniatis


-- 
-------------------------->
Aristedes Maniatis
GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A



      See the Web&#39;s breaking stories, chosen by people like you. Check out 
Yahoo! Buzz. http://in.buzz.yahoo.com/

Reply via email to