[ 
https://issues.apache.org/jira/browse/DELTASPIKE-1242?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mark Struberg reopened DELTASPIKE-1242:
---------------------------------------

There is indeed a subtle bug in our code which triggers this.

JPA specifies that cb.select must be used for counts, but we always use 
cb.multiselect. This triggers different handling.

If we only have a single return type we should use cb.select instead for 
improved compatibility. 
This might probably also improve the performance for other use cases.

> select distinct generates wrong JPQL
> ------------------------------------
>
>                 Key: DELTASPIKE-1242
>                 URL: https://issues.apache.org/jira/browse/DELTASPIKE-1242
>             Project: DeltaSpike
>          Issue Type: Bug
>          Components: Data-Module
>    Affects Versions: 1.7.2
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>
> The Data module generateds brackets into a distinct JPQL statement
> Instead of 
> {source}
> SELECT DISTINCT e.mycol from SomeEntity e
> {source}
> we currently generate:
> {source}
> SELECT DISTINCT(e.mycol) from SomeEntity e
> {source}
> But this is not correct according to the JPA spec. It also actually only 
> works on Hibernate but fails on both EclipseLink (RI) and OpenJPA.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to