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 03:02:53 GMT
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" <heiko@fork.de>
To: <turbine-user@jakarta.apache.org>
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 paul.hunter@bt.com 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: 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