Re: named-native-query with sql-result-set-mapping

2018-03-08 Thread Matthew Broadhead
BTW i am using OpenJPA 2.4.2 (JPA 2.0) strange but if i completely remove the result-set-mapping and simply use the resultClass parameter it works fine TypedQuery q = em.createNamedQuery("selectCategoryYear", CategoryYearResult.class); List categoryYearResultList = q.getResultList(); i did us

Re: named-native-query with sql-result-set-mapping

2018-03-08 Thread Matthew Broadhead
Query q = em.createNamedQuery("selectCategoryYear");         List objectList = q.getResultList();         for (Object o : objectList) {             System.out.println(o.getClass().getSimpleName());         } it says it is returning Object[] On 08/03/2018 13:46, Craig Taylor wrote: Try using long

Re: named-native-query with sql-result-set-mapping

2018-03-08 Thread Craig Taylor
Try using longs instead of integer. If you grab the result set without conversion you should be able to iterate through the list to see what is being returned. On Mar 8, 2018 07:38, "Matthew Broadhead" wrote: > hi i am trying to do a NamedNativeQuery with a SqlResultSetMapping and i > get javax

named-native-query with sql-result-set-mapping

2018-03-08 Thread Matthew Broadhead
hi i am trying to do a NamedNativeQuery with a SqlResultSetMapping and i get javax.el.ELException: java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to uk.me.kissy.file.entities.categoryYear.CategoryYearResult.  is this type of operation not supported? my orm.xml is     xmlns="