Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] JPQL: Retrieving data from a multi select query

Hello,

 

I have a multi select query and I need to retrieve all those fields in an object that will be display in a JSF 2.0 page.

 

This is my method code but I am afraid it is wrong,

 

public Map<String, Object> findAllEmailAddress(long employeeId) {

try {

String query = "SELECT EMAIL_TYPE, EMAIL_ADDRESS FROM EMAIL ea " +

"INNER JOIN EMPLOYEE emp " +

"ON ea.EMP_ID = emp.EMP_ID " +

"WHERE emp.EMP_ID = " + Long.toString(employeeId);

Query q = em.createNativeQuery(query);

return q.getHints();

} catch (javax.persistence.NoResultException nre) {

return null;

}

}

How do I must to do?

 

Thanks in advance,

Jose


Back to the top