----- Original Message -----
From: "John McNally" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 09, 2001 9:58 AM
Subject: Re: another intake question


>
> > > then in the action you can do
> > >
> > > Project project = torque object
> > > Group group = intake.get("Project", project.getQueryKey(), false);
> > > ... validate etc ...
> > > group.setProperties(project);
> > > project.save();
> >
> > I tried this initially, but project.queryKey() wasn't returning anything
> > because the project object hasn't been initialized. The only way I can
see
> > to initialize it would be to grab a variable from the form which was
> > submitted.
> >
>
> What do you mean the project is not initialized?  The example I gave
> would work for a Project that had already been saved in the db at some
> point in the past and had beed retrieved so that it could be updated.
> How are you doing an update on a new object/row?

I was doing Project project = new Project();

I have now switched it over to
Project project = ProjectPeer.retrieveByPk(New NumberKey(<field from
submit>);

Which now works like it should, is there a different way to retrieve a
previously saved item in the db that I'm missing?

-warner

> john mcnally
>
> ---------------------------------------------------------------------
> 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]

Reply via email to