openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pinaki Poddar <>
Subject Re: Can;t map AVG sql field to class
Date Fri, 21 Nov 2008 19:40:53 GMT

  The source of the problem seems to be
   > Query query = em.createNativeQuery(sb.toString(), InformerRow.class);

  Your query returns s5 - a Number. 

  While the above code is saying that the query result is an instance of
  So try something like:
   Query query  = em.createNativeQuery(sb.toString());
   Object result = query.getSingleResult();
   InformerRow ir = new InformerRow();
   ir.s5 = ((Number)result).intValue();

View this message in context:
Sent from the OpenJPA Users mailing list archive at

View raw message