cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dave Dombrosky" <>
Subject Should commitChangesToParent() call pre-persist method?
Date Tue, 19 Aug 2008 05:45:57 GMT
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?


View raw message