Re: [VOTE] Cayenne Release 3.0M1

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Thu Jul 26 2007 - 17:55:03 EDT

  • Next message: Michael Gentry: "Re: [VOTE] Cayenne Release 3.0M1"

    IMO with 3.0 being a major version change, it's a fair game to change
    API .. as long as we don't abuse it. And in fact you can setup a
    'PostLoad' callback to invoke existing 'fetchedFinished' on your
    objects, so there is a reasonable replacement. Even better - since
    POST_LOAD is executed between DataContext and DataDomain, you won't
    even have to switch to ObjectContext. Instead you can instantiate the
    DC with this bit of extra wiring (that will hopefully go away in the
    following milestones):

    // postInterceptor can be shared between multiple DataContexts
    DataChannelCallbackInterceptor postInterceptor = new
    DataChannelCallbackInterceptor();
    postInterceptor.setChannel(domain);
    ObjectStore objectStore = new ObjectStore
    (domain.getSharedSnapshotCache());

    DataContext context = new DataContext(postInterceptor, objectStore);

    // here is how you would register callbacks (once per app)
    LifecycleCallbackRegistry registry = domain.getEntityResolver
    ().getCallbackRegistry();
    registry.addListener(LifecycleListener.POST_LOAD, MyDataObject.class,
    "fetchFinished");

    Andrus

    On Jul 26, 2007, at 9:30 PM, Michael Gentry wrote:

    > OK, I finally was able to try to migrate my old 1.2.x project to 3.0.
    > After some missing jar (log4j, common collections, etc) issues and
    > renaming all of my packages from objectstyle to apache, I was able to
    > launch the application but it doesn't work. A good portion of my
    > application depends on fetchFinished() being called. Yes, I know
    > fetchFinished() is deprecated and the implementation in
    > CayenneDataObject still exists (and still does nothing), but it
    > appears the code to actually call it when the fetch is finished has
    > been removed, so I get lots of NULL objects (I resolve a lot of things
    > after a 'notification' object is read in). If fetchFinished() is
    > deprecated, shouldn't it still be called?
    >
    > Thanks,
    >
    > /dev/mrg
    >
    > PS. It did a lot of nice-looking SQL before failing, though. :-)
    >



    This archive was generated by hypermail 2.0.0 : Thu Jul 26 2007 - 17:55:30 EDT