I run a JPA 2.0 native query like this:
Query query = em.createNativeQuery(\"SELECT NAME, SURNAME, AGE FROM PERSON\");
List list = query.getResultList();
Take a look on this I got it when working on project that I could not use all JPA features so I tried the traditional jdbc method even if I would not recommend this but it's working for me.
@LocalBean
public class TCotisationEJB {
@PersistenceContext(unitName="ClaimsProjectPU")
private EntityManager em;
@TransactionAttribute(TransactionAttributeType.NEVER)
public List getCotisation(){
Query query=em.createNativeQuery("select Annee,Mois,RetSonarwa from TCotisMIFOTRA2008 where matricule='10000493' order by Annee");
List