Re: SQLResultMapping missing in RC2?

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Sun Feb 07 2010 - 07:11:17 EST

  • Next message: Andrus Adamchik: "Re: BUG: Cayenne Modeler"

    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
    >
    >



    This archive was generated by hypermail 2.0.0 : Sun Feb 07 2010 - 07:11:52 EST