Hi all,
I was using this chunk of code to return number of records in table:
SQLTemplate sq = new SQLTemplate(User.class, "SELECT COUNT(id) C from User;");
SQLResultSetMapping rsMap = new SQLResultSetMapping();
rsMap.addColumnResult("C");
sq.setResultSetMapping(rsMap);
Long users = (Long) DataObjectUtils.objectForQuery(getObjectContext(), sq);
This code worked the whole way with cayenne 3 but after upgrade to rc2
(maven repo) the SQLResultSetMapping class is missing. Did you change
some workflow and added alternative to this? If so then please could you
provide it?
Anyway, I find this piece of code rather colossal for simple procedure
as count (I figure this is a common usecase) so is there an easier way
to work with aggreagate functions?
TIA,
-- Marek Šabo
This archive was generated by hypermail 2.0.0 : Sun Feb 07 2010 - 06:40:18 EST