turbine-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Bachelder" <cho...@chowda.net>
Subject Re: object.save()
Date Sun, 28 Oct 2001 05:21:49 GMT
After working with a few more of my objects and needing this same behavior,
I have noticed that it is not consistent.. working from a clean DB, I have
some objects that will not give you the system generated key after an insert
unless you specify both new and modified as true.... out of three objects so
far only one needed new to be true and modified to be false... the other two
needed both to be true to get back the key... I have not had a chance to dig
through and discover why yet...

----- Original Message -----
From: "Scott Eade" <seade@backstagetech.com.au>
To: <turbine-user@jakarta.apache.org>
Sent: Sunday, October 28, 2001 12:09 AM
Subject: Re: object.save()


> 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" <chowda@chowda.net>
> To: <turbine-user@jakarta.apache.org>
> 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" <seade@backstagetech.com.au>
> > To: <turbine-user@jakarta.apache.org>
> > 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" <chowda@chowda.net>
> > > To: <turbine-user@jakarta.apache.org>
> > > 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: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Mime
View raw message