It's sort of odd that it lets you do both. I would have thought setNew()
would clear the modified flag and setModified() would clear the new flag.
Then if you invoke save() on a new record with the modified flag set an
exception ought to be thrown (due to the fact that no key value is set).
I haven't looked at the source, but this would make sense to me.
Scott
----- Original Message -----
From: "Dan Bachelder" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, October 28, 2001 2:28 PM
Subject: Re: object.save()
> ouch... good call.. why was I doing that? I'm pleading temporary
insanity...
>
>
>
> ----- Original Message -----
> From: "Scott Eade" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, October 27, 2001 11:24 PM
> Subject: Re: object.save()
>
>
> > 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?
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]