ROP: validation and callbacks

From: äÒÏ (dron435..andex.ru)
Date: Tue Feb 26 2008 - 07:39:31 EST

  • Next message: Alexander Lamb (dev): "Re: Raising an exception in a callback"

    Hi!

    I've got yet another question about ROP.
    First, i can't figure out how to invoke some existing validation code manually.

    Right now i don't have any 'Validating' interfaces implemented in my classes, but still there are some constraints provided by cayenne.xml (like maximum length of a text field).
    I guess this validation is invoked during 'validateForX' methods in SERVER classes. Note that CLIENT classes don't event implement the 'Validating' interface, because they extend 'PersistentObject', not 'CayenneDataObject'.
    i don't actually understand the ROP architecture, but it seems that server classes functions are somehow invoked during work with client classes. Also, if validation fails, i get exception with mention of server class.

    It is a good idea to check objects before making 'commintChanges', so the question is, how can i manually invoke that already existing validation from client side? And will my own validation work if i implement 'Validating' by client class (how will it collide with that existing validation)?

    The second problem is that lifecycle callbacks don't seem to work with ROP at all. I add listener to ObjectContext.getEntityResolver.getCallbackRegistry(), but it is never invoked. It this feature implemented?

    Thanks,
    Andrey



    This archive was generated by hypermail 2.0.0 : Tue Feb 26 2008 - 07:46:50 EST