Community
Participate
Working Groups
Build Identifier: Hello, I'm using eclipselink in glassfishv3, the latest 2.2 version. I'm creating a query using the CriteriaBuilder and CriteriaQuery from within a container managed stateless session bean. The query has also a subquery (I don't know if this is relevant). Problem: CriteriaQuery.groupBy(...) is called but completely ignored. I'm logging the SQL queries and I see no GROUP BY clause. Is groupBy() supposed to work in eclipselink? I've searched the BTS and Internet with no luck, I couldn't even find an groupBy() example. Reproducible: Always Steps to Reproduce: 1. Create a CriteriaBuilder. 2. Create a CriteriaQuery. 3. Use groupBy() 4. GROUP BY not generated
Can you please post your test code? We have tests that test our groupby support in CriteriaQueries and they continue to succeed.
(In reply to comment #1) > Can you please post your test code? We have tests that test our groupby > support in CriteriaQueries and they continue to succeed. Thanks for your help. I've tried with a more simple test case (count + group by an attribute) and it works (I see the GROUP BY in the logs). With my real case (a bit complicated to extract a test case) it does not. What are the cases where .groupBy() is not supposed to work (or ignored)? Maybe some error report is missing?
Closing as worksforme. Please reopen if you can provide code that allows us to recreate the problem.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink