Re: Saving a single object

From: Mike Kienenberger (mkienen..laska.net)
Date: Wed Apr 27 2005 - 20:19:03 EDT

  • Next message: Fredrik Liden: "RE: Saving a single object"

    =?ISO-8859-1?Q?Mika=EBl?= Cluseau <nwr..wrk.dyndns.org> wrote:
    > I'm sorry to ask that but neither google nor the cayenne doc enlighted
    > me on a stupid question... how do you save a single object? (yes, I must
    > support this feature...)

    The same way you save multiple items -- dataContextInstance.commitChanges();

    A simplified free-form example off the top of my head so there's probably
    errors:

    DataContext dc = DataContext.createNewDataContext();
    MyObject mo = dc.createAndRegisterNewObject(MyObject.class);
    mo.setBar("foo");
    dc.commitChanges();



    This archive was generated by hypermail 2.0.0 : Wed Apr 27 2005 - 20:17:18 EDT