croniccoder wrote: > Criteria c = new Criteria(); > c.addSelectColumn(AccountPeer.ACCOUNTNUMBER); > List list = AccountPeer.doSelect(c); > > > But this is throwing and exception, and I'm not sure why. Any ideas?? > > com.workingdogs.village.DataSetException: Only 1 columns exist!
I guess your Account table has more than this one column? The BaseAccountPeer methods try to create a real Account object from your result set which fails because there are more fields to set than columns are available in the result set. Two solutions: 1. Remove the line c.addSelectColumn(AccountPeer.ACCOUNTNUMBER); Torque will select all columns it requires and you will get nice, shiny Account objects in your list 2. Use BasePeer.doSelect(c) This will return a list of Records and you can query the value you want like record.getValue(1).asInt() This approach is slightly faster but actually not really Torque-like. Nevertheless we all have used this method by some means or other. Bye, Thomas. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
