Hi, Will Holcomb wrote:
>I have been looking at the BasePeer methods and I would like to do an >update like: > >update tbl set blah = blah + 1 where blah > blarg; > >Is this possible using criteria? I have been looking at the doUpdate() >methods and I am thinking no, I just wanted to double check. > I guess you could use : BasePeer.doUpdate(Criteria selectCriteria, Criteria updateValues); That way you should be able to tune your Sql statement as you wish.. > >Also, if I want an update and an insert in a single transaction would it >look like: > >Connection connection = Transaction.begin(BlahPeer.DATABASE); >BlahPeer.doUpdate(criteria, connection); >blah.save(connection); >Transaction.commit(connection); > I'm still using Torque beta2, so my transaction management rely on an old version where Torque used DbConnection, but almost the same way .. > >That is what I pieced together from looking at the methods on the classes. >Will that work? > >Will Holcomb > > > >-- >To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> >For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
