cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: SQLResultMapping missing in RC2?
Date Sun, 07 Feb 2010 12:11:17 GMT
SQLResultSetMapping got renamed in the course of 3.0 development to  
just SQLResult (from the commit logs, sometime in the fall of 2008).  
So you can just rename it in your code.

Let me also check the docs. There may be some mentions of  
SQLResultSetMapping that need to be updated.

Andrus

On Feb 7, 2010, at 1:39 PM, Marek Šabo wrote:

> 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