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 17:26:18 GMT
yes I am only using thing.getKeyName()

Hopefully when I get these features done, I'll have time to figure out why I
need both...

----- Original Message -----
From: "Heiko Braun" <heiko@fork.de>
To: <turbine-user@jakarta.apache.org>
Sent: Sunday, October 28, 2001 12:16 PM
Subject: Re: object.save()


>
> That's weired,
> i am using the setNew(true) without calling
> setModified() and it all works fine with new objects.
>
> Did you try to access the key by its name
> instead of using the getPrimaryKey() method?
>
>  --
>  heiko braun, fork unstable media
>  http://www.unstablemedia.com
>
>
> On Sun, 28 Oct 2001, Dan Bachelder wrote:
>
> > 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
> >
> >
>
>
>
>
> ---------------------------------------------------------------------
> 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