db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marc Lustig" <m...@marclustig.com>
Subject AW: how to simply retrieve value of existing row (was AW: how to use Peer.doUpdate(object))
Date Wed, 15 Jan 2003 13:08:44 GMT
Thanks!
That helped indeed.
I wasn't aware that I need to explictly load the row via retrieveByPk.

	object.setNew(false);
	object.setModified(true);
is not needed at all.

Marc

> -----Urspr√ľngliche Nachricht-----
> Von: Andras Balogh [mailto:andras@reea.net]
> Gesendet: Mittwoch, 15. Januar 2003 13:56
> An: Turbine Torque Users List
> Betreff: Re: how to simply retrieve value of existing row (was AW: how
> to use Peer.doUpdate(object))
>
>
>
> > In one case that helps in another not.
> > Also, if I do this:
> > Projekt projekt = new Projekt();
> > projekt.setPrimaryKey(new NumberKey(itemId));
> > projekt.setNew(false);
> >
> > then projekt.getProjektParaDescId();
> >
> > is NOT returning the value that is in the corresponding row!
> > How on earth is it possible to simply retrieve the value of an existing
> row?
> > This is so much of a simple task!
> >
> > Torque continues to drive me crazy sometimes as very simple tasks simply
> > don't appear to work intuitively at all.
> >
> > Marc
> >
>
>
> Hi,
>
> I think that you should do something like this:
> Projekt projekt=ProjectPeer.retrieveByPk(new NumberKey(itemId));
>
> Also regarding do Update i don't ever use this method only call
> object.save().
> The save method will decide that doInsert or doUpdate should be called.
> Another thing do not set the primary key of an object try loading
> the object
> insted by using the apropiate Peer.
>
>
>
>
> --
> To unsubscribe, e-mail:
> <mailto:turbine-torque-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:turbine-torque-user-help@jakarta.apache.org>
>


Mime
View raw message