Changing the createNativeQuery(sql) method to return a List<Object> or List<Object[]>.
According to the JPA 2.1 specification (JSR-338 Final Release, page 75, 4/2/13),
a native query is supposed to return a List<Object> or List<Object[]> and
not a List<Map>
Quote from JPA 2.1 spec:
/**
* Create an instance of Query for executing a native SQL
* statement, e.g., for update or delete.
* If the query is not an update or delete query, query
* execution will result in each row of the SQL result
* being returned as a result of type Object[] (or a result
* of type Object if there is only one column in the select
* list.) Column values are returned in the order of their
* appearance in the select list and default JDBC type
* mappings are applied.
* @param sqlString a native SQL query string
* @return the new query instance
*/
public Query createNativeQuery(String sqlString);
Changing the createNativeQuery(sql) method to return a
List<Object>
orList<Object[]>
.According to the JPA 2.1 specification (JSR-338 Final Release, page 75, 4/2/13), a native query is supposed to return a
List<Object>
orList<Object[]>
and not aList<Map>
Quote from JPA 2.1 spec: