db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott Shorter" <sshor...@orionsec.com>
Subject RE: update difficulties
Date Wed, 29 Oct 2003 16:48:38 GMT
Gary,

Oops.  I was assuming that "summary" was a field and didn't do my
research, so I guessed that it needed a constant field name from the
*Peer class.  Like I said, Torque newbie here...
-
Scott

> -----Original Message-----
> From: Gary Shea [mailto:shea@gtsdesign.com] 
> Sent: Wednesday, October 29, 2003 11:45 AM
> To: Apache Torque Users List
> Subject: RE: update difficulties
> 
> 
> Hi Scott --
> 
> Thanks for jumping in!
> 
> There are three different save() signatures: no args, a 
> Connection, and a database name.  The one I've used is the 
> database name.  I don't see one that takes a field name... 
> what did you have in mind?
> 
> Regards,
> 
>         Gary
> 
> [2003-10-29 08:28 -0500] Scott Shorter (sshorter@orionsec.com) wrote:
> 
> > I know I'm just a newb here myself, but have you tried
> > 
> > 	record.save(TransSummaryPeer.SUMMARY);
> > --
> > Scott
> > 
> > 
> > > -----Original Message-----
> > > From: Gary Shea [mailto:shea@gtsdesign.com]
> > > Sent: Wednesday, October 29, 2003 12:50 AM
> > > To: torque-user@db.apache.org
> > > Subject: update difficulties
> > > 
> > > 
> > > This is probably user error, but I'm having trouble with
> > > doUpdate(*). I have dug through the code and searched the 
> > > archives to no avail.  I'm going to keep going in the code, 
> > > but if anyone can explain this, please do!
> > > 
> > > I have used Torque to generate a schema and classes.  I 
> do a simple
> > > lookup:
> > >         
> > >         Criteria criteria = new Criteria("summary");
> > >         criteria.addIn(TransSummaryPeer.XID, xids);
> > >         Collection records = TransSummaryPeer.doSelect(criteria);
> > > 
> > > and then modify a record returned in the collection using
> > > Apache BeanUtils:
> > > 
> > >         PropertyUtils.setProperty(
> > >             record, propName,
> > >             PropertyUtils.getProperty(vo, propName));
> > > 
> > > and print out the Torque object to insure that the 
> property has in 
> > > fact changed: it has.  Check if 'modified' is true: it 
> is. Attempt 
> > > to save the changes:
> > >        
> > >         record.save("summary");
> > > 
> > > Look in the mysql log, and NOTHING HAPPENED!  Nor is an
> > > exception thrown, unless it's being swallowed somewhere in 
> > > Torque.  I am completely baffled.  I have yet to find a path 
> > > through the code that can have no effect...
> > > 
> > > Interestingly, if I create a TransSummary object 'record'
> > > with an xid (primary key) for which there is as yet no record 
> > > in the database, so that 'new' is true:
> > > 
> > >     record.save("summary");
> > > 
> > > works fine, storing the object into a database record.
> > > 
> > > Clues?
> > > 
> > > Thanks,
> > > 
> > >         Gary
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message