Considering the following common data structure:
In our app, the user may change and add a number of ChildProxies as well as ParentProxy properties, then save everything.
When I'm creating a new ChildProxy, I call ParentRequestContext.create() to obtain this, which registers this with the RequestContext. This is then passed to an editor, flushed and added to the editor hierarchy.
The whole hierarchy is then flushed and persisted.
This works well, except I cannot handle the case when a new ChildProxy is requested but this is then cancelled - the RequestContext will send a ChildProxy with null values.
So -- is there a way to cancel a pending create?
Otherwise the only workaround I can think of is to utilize a separate RequestContext to create a "detached" ChildProxy and edit then flush this.
Then all being well, the to-be-persisted ChildProxy would be obtained from ParentRequestContext,create and I'd use AutoBeanUtils to copy the detached state to the new proxy.