cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marek Šabo <ms...@buk.cvut.cz>
Subject SQLResultMapping missing in RC2?
Date Sun, 07 Feb 2010 11:39:39 GMT
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


Mime
View raw message