Below is the test showing that everything's OK (or you can change event type
to PRE_PERSIST with same effect). Lachlan, please double-check that all
callbacks are mapped correctly and give us more details about errors.
public class ROPCallbacksTest extends RemoteCayenneCase {
public void testPostAddCallbacks() {
LifecycleCallbackRegistry registry = getDomain()
.getEntityResolver()
.getCallbackRegistry();
registry.addListener(LifecycleEvent.POST_ADD, MtTable1.class, this,
"postAddCallback");
ObjectContext ropContext = createROPContext();
ClientMtTable1 a1 = ropContext.newObject(ClientMtTable1.class);
ropContext.commitChanges();
}
public void postAddCallback(Object o) {
((MtTable1) o).setGlobalAttribute1("POST_ADD");
}
}
2009/10/30 Andrey Razumovsky <razumovsky.andre..mail.com>
> Actually, I won't be connected to the internet, so I will not commit until
> Monday anyways. So please go ahead
>
> 2009/10/30 Andrus Adamchik <andru..bjectstyle.org>
>
>>
>> On Oct 30, 2009, at 10:57 AM, Andrey Razumovsky wrote:
>>
>> This is not about callbacks on client-side - as far as I know, we don't
>>> have
>>> callbacks on ROP.
>>>
>>
>> Ah great. I wasn't sure about the status of that.
>>
>>
>> If I understand correctly, "prePersist" isn't invoked for
>>> server-side temporary objects when committing from client.
>>> I'll try to do that on the weekend, but I'm not sure
>>>
>>
>> Let me know. I can take a look as well if needed.
>>
>> Andrus
>>
>>
>
>
> --
> Andrey
>
-- Andrey
This archive was generated by hypermail 2.0.0 : Fri Oct 30 2009 - 06:18:57 EDT