Dan,
Don't do this:
> contact.setModified(true);
and see what happens.
Scott
----- Original Message -----
From: "Dan Bachelder" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, October 28, 2001 2:02 PM
Subject: Re: object.save()
> I am not seeing this behavior... after:
>
> Contact contact = new Contact();
> data.getParameters().setProperties(contact);
> contact.setModified(true);
> contact.setNew(true);
> contact.save();
> logDebug("inserted contact with key: " +
> contact.getContactId());
>
> I am seeing null as the key... but I confirm that the data is being
inserted
> into the database with an auto generated key.. this is with the TDK2.1...
I
> see how I can change the OM generation templates to return the key, but it
> seems like this must be something someone is doing with the TDK already..
> how are you doing it?
>
> ----- Original Message -----
> From: "Heiko Braun" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, October 15, 2001 12:24 PM
> Subject: Re: object.save()
>
>
> >
> > yup, thats the way it should work.
> > i didnt try it through getPrimaryKey(),
> > but with a specific key. (like getFooId())
> >
> >
> > --
> > heiko braun, fork unstable media
> > http://www.unstablemedia.com
> >
> >
> > On Mon, 15 Oct 2001 [EMAIL PROTECTED] wrote:
> >
> > > Can anybody tell me if calling save() on a new object sets the primary
> key
> > > id of the object, so that I can say getPrimaryKey() after calling
save.
> > > The reason being I need the PK of the newly created object after
calling
> > > save and I know doInsert on the objectPeer class returns the PK but I
> can't
> > > seem to work out if the save method sets the PK?
> > >
> > > I want to say
> > > object.save(); /*object does not have the primary key set as I am
using
> an
> > > auto increment*/
> > > pk = object.getPrimaryKey();
> > >
> > > Cheers
> > >
> > > Paul
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]