Re: Temporary Objects

From: Mike Kienenberger (mkienen..mail.com)
Date: Tue Mar 27 2007 - 16:10:54 EDT

  • Next message: Peter Karich: "Re: Temporary Objects"

    Your second problem (trying to add references to non-persistent
    objects to a persistent object) is a hard one. If you post what
    you're trying to do specifically, maybe someone can suggest an
    alternate design pattern. By default, Cayenne attempts to initialize
    persistence if it finds a non-persisted object being added to the
    object graph. Maybe the solution is to construct your non-persisted
    objects in a "COMMITTED" state so that Cayenne doesn't have issues
    with them.

    On 3/27/07, Peter Karich <peatha..ahoo.de> wrote:
    > > I'm missing something. I don't understand why you don't do something
    > > along these lines.
    > >
    > > nonpersistentObject.setObjectId(new Timestamp());
    >
    > Yes! I was trapped in my idea that a pk has to be integer :-(
    > Thank you!
    >
    > > You don't have to use the same kinds of object ids for your
    > > non-persistent objects, and using a different type will guarantee that
    > > a persistent and non-persistent object will never be equal to each
    > > other.
    >
    > And what about the NullPointerException I mentioned in the first email?
    >
    > Peter.
    >
    >
    > ___________________________________________________________
    > Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de
    >



    This archive was generated by hypermail 2.0.0 : Tue Mar 27 2007 - 16:11:59 EDT