Cool, and we are now discussing on the dev list how to make the API more
straightforward by removing the need to cast.
Andrus
On Sep 6, 2013, at 8:20 AM, Markus Reich wrote:
> Hi,
>
> works perfect!! API docu was just a bit confusing concerning the new method
> for creating a child context :-
Hi,
works perfect!! API docu was just a bit confusing concerning the new method
for creating a child context :-(
Thank you
Meex
2013/9/5 Andrus Adamchik
> Here is how you create a child context in 3.2 (in 3.1 'newContext' was
> called 'getContext', otherwise it is similar) :
>
> ObjectContext
It's probably worth noting that you can iterate over the properties
and relationships in a generic fashion during runtime rather than
manually maintain a static list of values to copy or generating it
with a template.
On Thu, Sep 5, 2013 at 1:19 PM, Andrus Adamchik wrote:
> IMO creating a new obj
IMO creating a new object and initializing it afresh is the way to go.
Andrus
On Sep 5, 2013, at 12:33 PM, Jurgen wrote:
> If a user tries to commit an object that has been deleted in the DB (by
> another user) then cayenne throws an exception.
>
> If the desired recovery mode is that the ob
Here is how you create a child context in 3.2 (in 3.1 'newContext' was called
'getContext', otherwise it is similar) :
ObjectContext context = runtime.newContext();
ObjectContext childContext = runtime.newContext((DataChannel) context);
I.e. the parent context is a channel of the child. The cast
You aren't creating the child context correctly. I don't recall the proper
way to do it in 3.1+
On Thu, Sep 5, 2013 at 8:11 AM, Markus Reich wrote:
> ah ok, thx!
>
> But I still don't understand the whole thing :-(
>
> No the test reacts like this
>
> @Test
> public void testChildContext()
ah ok, thx!
But I still don't understand the whole thing :-(
No the test reacts like this
@Test
public void testChildContext() {
// create test instance
MiiPickingcontainer container =
MiiPickingcontainer.createInstance(context, "", "", "JUNIT");
context.commitChanges();
You have to assign the result of localObject.
John
On Sep 5, 2013 12:59 AM, "Markus Reich" wrote:
> Hi,
>
> I've a question concering child contexts, when I add an object to a child
> context with method localObject, I thought the object is really from parent
> to child context?
>
> But when I r
If a user tries to commit an object that has been deleted in the DB (by another
user) then cayenne throws an exception.
If the desired recovery mode is that the object be inserted back into the DB,
how would one instruct Cayenne to do so now ?
I suppose setPersistanceState( NEW ) is not going t