Impetus / kundera

A JPA 2.1 compliant Polyglot Object-Datastore Mapping Library for NoSQL Datastores.Please subscribe to:
http://groups.google.com/group/kundera-discuss/subscribe
Apache License 2.0
903 stars 233 forks source link

Changing the createNativeQuery(sql) method to return a List<Object> or List<Object[]> #998

Closed AntonYudin closed 6 years ago

AntonYudin commented 6 years ago

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);