Re: Local Object

2010-07-10 Thread Lachlan Deck
On 11/07/2010, at 3:21 AM, Michael Gentry wrote: > Well, if you want it in CayenneDataObject, you'd have to pass the > target ObjectContext to the method, but that might be a pretty good > place for it, too. Silly me (for replying when tired), thanks. That was what I meant to say. public T local

Re: Local Object

2010-07-10 Thread Michael Gentry
Well, if you want it in CayenneDataObject, you'd have to pass the target ObjectContext to the method, but that might be a pretty good place for it, too. mrg On Sat, Jul 10, 2010 at 6:40 AM, Lachlan Deck wrote: > On 10/07/2010, at 2:12 AM, Andrus Adamchik wrote: > >> >> On Jul 9, 2010, at 6:41 P

Re: Local Object

2010-07-10 Thread Lachlan Deck
On 10/07/2010, at 2:12 AM, Andrus Adamchik wrote: > > On Jul 9, 2010, at 6:41 PM, Michael Gentry wrote: > >> I was thinking we'd add a utility type method for now. > > Cool. > >> I have no >> expectations of modifying 3.0 for this, but was thinking it might be >> good in the future to have som

Re: Local Object

2010-07-09 Thread Andrus Adamchik
On Jul 9, 2010, at 6:41 PM, Michael Gentry wrote: I was thinking we'd add a utility type method for now. Cool. I have no expectations of modifying 3.0 for this, but was thinking it might be good in the future to have something similar. I am sure we will. I am stumbling over 'localObject'

Re: Local Object

2010-07-09 Thread Michael Gentry
I was thinking we'd add a utility type method for now. I have no expectations of modifying 3.0 for this, but was thinking it might be good in the future to have something similar. Thanks, mrg On Fri, Jul 9, 2010 at 11:18 AM, Andrus Adamchik wrote: > I am not comfortable with adding a new publ

Re: Local Object

2010-07-09 Thread Andrus Adamchik
I am not comfortable with adding a new public ObjectContext method that will be hard to remove in the future. And I suspect it *will* be removed/renamed. I know this is bad situation, as likely it won't get implemented quickly (and most certainly not on 3.0 branch), and you would want to us

Re: Local Object

2010-07-09 Thread Michael Gentry
Our particular use-case is pulling objects into a child DC to edit and isolate changes. Something like: User localUser = childContext.localObject(user.getObjectId(), user); Just seems like that can be simplified a bit for the developers. Thanks, mrg On Fri, Jul 9, 2010 at 10:50 AM, Andrus Ad

Re: Local Object

2010-07-09 Thread Andrus Adamchik
Actually "localObject" is too loaded, performing a set of vaguely related distinct tasks... It has to be split into multiple methods (and IIRC we discussed it briefly some time ago). This particular variety is closer to "merge", vs. "localObject(id, null)" which is something like "locate"..

Local Object

2010-07-09 Thread Michael Gentry
Would it make sense to add: public Persistent localObject(Persistent source) { return localObject(source.getObjectId(), source) } to DataContext and friends? We are starting to use that a bit here and it seems like it would be much simpler to me. Thanks, mrg