I'm trying to get a query result in List<Object[]> type by a named native query, which is defined at the orm.xml.
When I run the code, it gives me an error as following:
Cannot create TypedQuery for query with more than one return using requested result type
Here's the orm.xml
<named-native-query name="UserInfo.findByCompCode" result-set-mapping="tmp">
<query>
SELECT
A.USER_ID
, B.USER_AREA_CODE
FROM
USER A
, USER_DETAIL B
WHERE
A.USER_ID = B.USER_ID
AND A.COMP_CODE = '01'
<query>
</named-native-query>
<sql-result-set-mapping name="tmp">
<column-result name="USER_ID" />
<column-result name="USER_AREA_CODE" />
</sql-result-set-mapping>
The return type of the repository is List<Object[]>.
How can I get the query result in List<Object[]> type?
Thanks in advance