cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: Newbie Question: Mapping a Collection of Strings
Date Wed, 26 Aug 2009 13:44:55 GMT
Hi Brett,

You will have to map a Keyword class in both 2.0 and 3.0, and maybe  
create a cover method converting a list of Keywords to a list of  
Strings on the fly.

3.0 supports something called "flattened attributes", which is what  
you describe, but only for to-one relationships.

Andrus

On Aug 26, 2009, at 5:08 AM, Bret Gregory wrote:

> I have a DB that looks something like this:
>
> Product
> -ProductId
> -Description
>
> Keyword
> -ProductId
> -Keyword
>
> Where Product -> Keyword is 1:N and Keyword has a FK rel back to  
> Product.
>
> I would like the object model to look something like this:
>
> Product
> -(String) _description
> -(List<String>) _keywords
>
> Is it possible to map collections of simple objects and have them  
> persisted by Cayenne?  Seems like this would be a pretty common  
> request, but
> I am not seeing a way to do this in the modeler.
>
>
>
>


Mime
View raw message