Re: Moving 3 tier (ObjectContext problem)

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Wed Dec 07 2005 - 08:25:31 EST

  • Next message: Cris Daniluk: "Re: DataObjectUtils.objectForPK() caches- is there a way to not use the cache on this one?"

    Ok, this is in. The API below will be included in the nightly builds
    starting from 12/08/2005. Alternatively you may want to wait until M9
    goes out.

    Andrus

    On Dec 7, 2005, at 10:54 AM, Andrus Adamchik wrote:
    > Marcin,
    >
    > This is indeed an omission in the new API - good catch. I'll add it
    > in a few days and post a note here when it becomes available in the
    > nightly build.
    >
    > Note that your method will not work as it disregards the objects
    > that got in the context via a query. Instead once I add this
    > functionality, you will be able to do something like this:
    >
    > objectContext.getGraphManager().getNodes();
    >
    > Stay tuned.
    >
    > Andrus
    >
    >
    > On Dec 7, 2005, at 4:11 AM, Marcin Skladaniec wrote:
    >
    >> Hi All
    >> How can I access all objects registered with context ?
    >> With DataContext it can be done like this:
    >>
    >> java.util.Iterator iterator = ((ObjectStore)
    >> dataContext.getObjectStore()).getObjectIterator();
    >>
    >> I was looking for the way to do the same with ObjectContext. Do I
    >> have to subclass CayenneContext to get that feature ?
    >>
    >>
    >> If I'm going to subclass CayenneContext, I see it this way :
    >>
    >> public class ClientDataContext extends CayenneContext {
    >> Vector ObjectsRegisteredWithThisContext = new Vector();
    >>
    >> public List getRegisteredObjects() {
    >> return ObjectsRegisteredWithThisContext;
    >> }
    >>
    >> public Persistent newObject(Class persistentClass) {
    >> Persistent result = super.newObject(persistentClass);
    >> ObjectsRegisteredWithThisContext.add(result);
    >> return result;
    >> }
    >> .
    >> .
    >> .
    >> }
    >>
    >>
    >> Marcin Skladaniec
    >
    >



    This archive was generated by hypermail 2.0.0 : Wed Dec 07 2005 - 08:25:34 EST