Search code examples
jpaeclipselink

JPA- Map the resultset from a stored procedure call to an entity class


I am using eclipselink, and I have the following code to call a stored procedure:
Query q = em.createNativeQuery("exec ....");
List list = q.getResultList();

Is it possible to map this list to a customized entity class that I created?


Solution

  • TypeQuery q= em.createNativeQuery("exec....",YOURENTITY.class); List list=q.getResultList();