GitHub user Danny02 opened a pull request:
https://github.com/apache/deltaspike/pull/52
Enable other Entity types as return from native repository queries
At the moment native queries can only return the same entity type as of the
repository.
A special flag exist on the @Query annotation to disable mapping, this
enables the possibility to return unmapped types as String, Date or Integer.
This change uses the return type of the method with the @Query annotation.
If the type is java.util.List, it uses the generic type.
It should be checked if this behaviour is correct for all JPA providers and
if some special logging is needed.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/Danny02/deltaspike
native_query_generic_return_fix
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/deltaspike/pull/52.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #52
----
commit 69cbb4fba458d090124d4262c388fbc3df4a4a3f
Author: mmain\heda151 <[email protected]>
Date: 2016-06-02T11:03:40Z
use return type of query method in native queries to build correct entity
type
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---