You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cayenne.apache.org by Michael Gentry <bl...@gmail.com> on 2007/06/28 17:18:07 UTC

writeNestedProperty?

For some reason, I thought CayenneDataObject had a
writeNestedProperty() method, but it doesn't seem to.  It looks like
PropertyUtils has the ability to do this, though (although I might
need to patch it).  Would it make since to make writing nested paths
available in CayenneDataObject, too?

Also, while I'm thinking of path-type things, would it make since to
change readNestedProperty() to handle this case (quoting from the
JavaDoc):

Read to-many relationship in the middle of the path (throws exception):
String name = (String)artist.readNestedProperty("paintingArray.paintingName");

If memory serves, I believe EOF handles this situation by returning an
array or list of paintingName values.  Then you could do:

List names = (List) artist.readNestedProperty("paintingArray.paintingName");

Thanks,

/dev/mrg

Re: writeNestedProperty?

Posted by Michael Gentry <bl...@gmail.com>.
Hey, look at that!  I was rambling about the same things a year ago,
too.  I'll open up two JIRA issues and assign them to me.

Thanks!

/dev/mrg


On 6/28/07, Andrus Adamchik <an...@objectstyle.org> wrote:
>
> On Jun 28, 2007, at 6:18 PM, Michael Gentry wrote:
>
> > For some reason, I thought CayenneDataObject had a
> > writeNestedProperty() method, but it doesn't seem to.  It looks like
> > PropertyUtils has the ability to do this, though (although I might
> > need to patch it).  Would it make since to make writing nested paths
> > available in CayenneDataObject, too?
>
> There was a thread on that some time back. I think there were no
> objections to adding it:
>
> http://objectstyle.org/cayenne/lists/cayenne-user/2006/06/0180.html
>
>
> > Also, while I'm thinking of path-type things, would it make since to
> > change readNestedProperty() to handle this case (quoting from the
> > JavaDoc):
> >
> > Read to-many relationship in the middle of the path (throws
> > exception):
> > String name = (String)artist.readNestedProperty
> > ("paintingArray.paintingName");
> >
> > If memory serves, I believe EOF handles this situation by returning an
> > array or list of paintingName values.  Then you could do:
> >
> > List names = (List) artist.readNestedProperty
> > ("paintingArray.paintingName");
>
> I am +1 - that's an important feature. But to be fully consistent, we
> need to make sure it works for POJOs the same way (when filtering in-
> memory with Expressions).
>
> Andrus
>

Re: writeNestedProperty?

Posted by Andrus Adamchik <an...@objectstyle.org>.
On Jun 28, 2007, at 6:18 PM, Michael Gentry wrote:

> For some reason, I thought CayenneDataObject had a
> writeNestedProperty() method, but it doesn't seem to.  It looks like
> PropertyUtils has the ability to do this, though (although I might
> need to patch it).  Would it make since to make writing nested paths
> available in CayenneDataObject, too?

There was a thread on that some time back. I think there were no  
objections to adding it:

http://objectstyle.org/cayenne/lists/cayenne-user/2006/06/0180.html


> Also, while I'm thinking of path-type things, would it make since to
> change readNestedProperty() to handle this case (quoting from the
> JavaDoc):
>
> Read to-many relationship in the middle of the path (throws  
> exception):
> String name = (String)artist.readNestedProperty 
> ("paintingArray.paintingName");
>
> If memory serves, I believe EOF handles this situation by returning an
> array or list of paintingName values.  Then you could do:
>
> List names = (List) artist.readNestedProperty 
> ("paintingArray.paintingName");

I am +1 - that's an important feature. But to be fully consistent, we  
need to make sure it works for POJOs the same way (when filtering in- 
memory with Expressions).

Andrus