You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltaspike.apache.org by "VITALIY SAVCHENKO (JIRA)" <ji...@apache.org> on 2016/03/07 11:20:40 UTC
[jira] [Updated] (DELTASPIKE-1089) No possible to select non Entity
object via Native query
[ https://issues.apache.org/jira/browse/DELTASPIKE-1089?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
VITALIY SAVCHENKO updated DELTASPIKE-1089:
------------------------------------------
Description:
After DELTASPIKE-978 in repository no possible to to select non Entity object via Native query.
For example(very simple):
{code:java}
@Query(
isNative = true,
value = " SELECT name " +
" FROM actions " +
)
@Override
public abstract Collection<String> listActions();
{code}
Reason:
Changes in AnnotatedQueryBuilder.java
- result = params.applyTo(entityManager.createNativeQuery(jpqlQuery));
+ result = params.applyTo(entityManager.createNativeQuery(jpqlQuery, context.getEntityClass()));
Now native query can return only Entity of this repository.
was:
After DELTASPIKE-978 in repository no possible to to select non Entity object via Native query.
For example(very simple):
{code:java}
@Query(
isNative = true,
value = " SELECT name " +
" FROM actions " +
)
@Override
public abstract Collection<String> listActions();
{code}
Reason:
Changes in AnnotatedQueryBuilder.java
- result = params.applyTo(entityManager.createNativeQuery(jpqlQuery));
+ result = params.applyTo(entityManager.createNativeQuery(jpqlQuery, context.getEntityClass()));
Now native query can return only Entity of this repository.
> No possible to select non Entity object via Native query
> --------------------------------------------------------
>
> Key: DELTASPIKE-1089
> URL: https://issues.apache.org/jira/browse/DELTASPIKE-1089
> Project: DeltaSpike
> Issue Type: Bug
> Reporter: VITALIY SAVCHENKO
>
> After DELTASPIKE-978 in repository no possible to to select non Entity object via Native query.
> For example(very simple):
> {code:java}
> @Query(
> isNative = true,
> value = " SELECT name " +
> " FROM actions " +
> )
> @Override
> public abstract Collection<String> listActions();
> {code}
> Reason:
> Changes in AnnotatedQueryBuilder.java
> - result = params.applyTo(entityManager.createNativeQuery(jpqlQuery));
> + result = params.applyTo(entityManager.createNativeQuery(jpqlQuery, context.getEntityClass()));
> Now native query can return only Entity of this repository.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)