Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 314026 - groupBy ignored in criteria
Summary: groupBy ignored in criteria
Status: CLOSED WORKSFORME
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-22 17:53 EDT by lethalman88 CLA
Modified: 2022-06-09 10:31 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description lethalman88 CLA 2010-05-22 17:53:48 EDT
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
Comment 1 Gordon Yorke CLA 2010-05-27 09:18:43 EDT
Can you please post your test code?  We have tests that test our groupby support in CriteriaQueries and they continue to succeed.
Comment 2 lethalman88 CLA 2010-05-29 18:05:40 EDT
(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?
Comment 3 Tom Ware CLA 2010-06-07 14:35:16 EDT
Closing as worksforme.  Please reopen if you can provide code that allows us to recreate the problem.
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:31:17 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink