iveQuery(
      "SELECT c.id, c.name, COUNT(o) as orderCount, AVG(o.price) AS avgOrder " +
      "FROM Customer c, Orders o " +
      "WHERE o.cid = c.id " +
      "GROUP BY c.id, c.name",
      "CustomerDetailsResult");

   &#064;SqlResultSetMapping(
       name="CustomerDetailsResult",
       classes={
          &#064;ConstructorResult(
               targetClass=com.acme.CustomerDetails.class,
                 columns={
                    &#064;ColumnResult(name="id"),
                    &#064;ColumnRe