cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Gentry" <blackn...@gmail.com>
Subject Re: flattened relationship updating
Date Fri, 17 Nov 2006 13:45:16 GMT
I've not flattened relationships in Cayenne yet, but this could be a
bug/glitch (or a design choice).  I went looking and saw this note in
the docs: Most of flattened relationships are treated as read-only by
Cayenne.  I just tried creating one in my test model, too, and the
modeler shows it as read-only, so this really might be a design
choice.

I remember EOF having a similar problem (not sure if the newest EOF
still does).  What we would do in EOF to work around the issue is to
write cover method code ourselves to manually flatten the
relationships.  This seemed to work pretty well and probably would in
Cayenne, too.  In your Gallery.java, try writing a getPaintings()
method.

/dev/mrg


On 11/16/06, Marcin Skladaniec <marcin@ish.com.au> wrote:
> Hello
>
> I have a schema which goes something like this:
>
> Gallery (one)->(many) Artist (one)-> (many) Paintings
>
> I access the Paintings very often from the Gallery, and to make my
> life easier I have flattened the relationship :
> Gallery (one) -> (many) Paintings
>
> Now when the relationships are not changing everything is ok, but
> when I alter the Artist -> Paintings relationship Gallery -> Painting
> does not notice it, and still displays the old list. Is it my fault,
> and I should not do flattening like this, should I do some kind of
> refresh, or is it a minor bug in cayenne ?
>
> Regards
> Marcin
>

Mime
View raw message