Should commitChangesToParent() call pre-persist method?

From: Dave Dombrosky (dombr..mail.com)
Date: Tue Aug 19 2008 - 01:45:57 EDT

  • Next message: Andrus Adamchik: "Re: PK ID retrieval code generation seems to fail"

    Should commitChangesToParent() call my pre-persist method?

    I have coded up a pre-persist listener to set my object's type for
    cayenne inheritance, and also to create some new objects to fill in
    required relationships. The problem I am running into is that my
    pre-persist method gets called twice. Once when i register my object
    with the child context, and once again when the changes are committed
    to parent. This causes issues because I my relationships point to
    unfilled objects, and when I try to commit I get validation errors
    because of these extra objects.

    Is this the expected behavior of pre-persist? If so, then where would
    be a good place to initialize required relationships?

    -Dave



    This archive was generated by hypermail 2.0.0 : Tue Aug 19 2008 - 01:46:41 EDT