You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Borut Bolčina <bo...@gmail.com> on 2008/06/04 14:34:18 UTC

DataContext - new method wanted

Hello,

If I have a collection of transient CayenneDataObjects with no relations
between any of them and want to persist them, it would be convenient to
"say":

context.registerObjects(myCayenneDataObjects); // sets state to NEW
context.commitChanges();

Now there is only a singular form of this method
http://cayenne.apache.org/doc/api/org/apache/cayenne/ObjectContext.html#registerNewObject(java.lang.Object)

But probably there is a reason for not having this method.

Cheers,
Borut

Re: DataContext - new method wanted

Posted by Borut Bolčina <bo...@gmail.com>.
Hi,

context.deleteObjects(Collection objects)
http://cayenne.apache.org/doc/api/org/apache/cayenne/access/DataContext.html#deleteObjects(java.util.Collection)

already exists, so I see some sense in adding
context.registerObjects(Collection objects) from this perspective.

Cheers,
Borut

2008/6/4 Andrus Adamchik <an...@objectstyle.org>:

> There's been some effort to keep only the essential non-redundant methods
> in the ObjectContext interface to make it more flexible for nested/ROP
> operation and to simplify its proxying. I am neutral to adding the new
> method to the *DataContext class*, as long as it doesn't make it to the
> interface.
>
> Andrus
>
>
>
> On Jun 4, 2008, at 4:36 PM, Michael Gentry wrote:
>
>  This seems reasonable.  I'll open a ticket for it later.
>>
>> Thanks,
>>
>> /dev/mrg
>>
>>
>> On Wed, Jun 4, 2008 at 8:34 AM, Borut Bolčina <bo...@gmail.com>
>> wrote:
>>
>>> Hello,
>>>
>>> If I have a collection of transient CayenneDataObjects with no relations
>>> between any of them and want to persist them, it would be convenient to
>>> "say":
>>>
>>> context.registerObjects(myCayenneDataObjects); // sets state to NEW
>>> context.commitChanges();
>>>
>>> Now there is only a singular form of this method
>>>
>>> http://cayenne.apache.org/doc/api/org/apache/cayenne/ObjectContext.html#registerNewObject(java.lang.Object)<http://cayenne.apache.org/doc/api/org/apache/cayenne/ObjectContext.html#registerNewObject%28java.lang.Object%29>
>>>
>>> But probably there is a reason for not having this method.
>>>
>>> Cheers,
>>> Borut
>>>
>>>
>

Re: DataContext - new method wanted

Posted by Andrus Adamchik <an...@objectstyle.org>.
There's been some effort to keep only the essential non-redundant  
methods in the ObjectContext interface to make it more flexible for  
nested/ROP operation and to simplify its proxying. I am neutral to  
adding the new method to the *DataContext class*, as long as it  
doesn't make it to the interface.

Andrus


On Jun 4, 2008, at 4:36 PM, Michael Gentry wrote:

> This seems reasonable.  I'll open a ticket for it later.
>
> Thanks,
>
> /dev/mrg
>
>
> On Wed, Jun 4, 2008 at 8:34 AM, Borut Bolčina  
> <bo...@gmail.com> wrote:
>> Hello,
>>
>> If I have a collection of transient CayenneDataObjects with no  
>> relations
>> between any of them and want to persist them, it would be  
>> convenient to
>> "say":
>>
>> context.registerObjects(myCayenneDataObjects); // sets state to NEW
>> context.commitChanges();
>>
>> Now there is only a singular form of this method
>> http://cayenne.apache.org/doc/api/org/apache/cayenne/ObjectContext.html#registerNewObject(java.lang.Object)
>>
>> But probably there is a reason for not having this method.
>>
>> Cheers,
>> Borut
>>


Re: DataContext - new method wanted

Posted by Michael Gentry <bl...@gmail.com>.
This seems reasonable.  I'll open a ticket for it later.

Thanks,

/dev/mrg


On Wed, Jun 4, 2008 at 8:34 AM, Borut Bolčina <bo...@gmail.com> wrote:
> Hello,
>
> If I have a collection of transient CayenneDataObjects with no relations
> between any of them and want to persist them, it would be convenient to
> "say":
>
> context.registerObjects(myCayenneDataObjects); // sets state to NEW
> context.commitChanges();
>
> Now there is only a singular form of this method
> http://cayenne.apache.org/doc/api/org/apache/cayenne/ObjectContext.html#registerNewObject(java.lang.Object)
>
> But probably there is a reason for not having this method.
>
> Cheers,
> Borut
>