Re: How to integrate Cayenne with non persisting object

From: Aristedes Maniatis (ar..aniatis.org)
Date: Sat May 22 2010 - 03:50:04 UTC

  • Next message: Andrew Lindesay: "Re: Blobs in the DataContext"

    On 22/05/10 2:44 AM, Galia Yer wrote:
    > Artist picasso = context.newObject(Artist.class);
    >
    > This create a persist object, I'd like to initialize a non persisting object and make it persisting only after some validation or similar conditions.

    Just because you created a persistent object doesn't mean that you are required to save it to the database. You can throw away the context or remove it from the context before committing. You code can do anything it like with that object in terms of validating it before you decide to commit.

    Ari

    -- 
    -------------------------->
    Aristedes Maniatis
    GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A
    



    This archive was generated by hypermail 2.0.0 : Sat May 22 2010 - 03:50:46 UTC