Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 366061

Summary: getGroupList() returned null instead of an empty list when no grouping expressions has been specified
Product: z_Archived Reporter: Stephen DiMilla <stephen.dimilla>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: CLOSED FIXED QA Contact:
Severity: blocker    
Priority: P3 CC: lance.andersen, stephen.dimilla, tom.ware
Version: unspecified   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
proposed fix none

Description Stephen DiMilla CLA 2011-12-08 11:32:00 EST
Build Identifier: eclipselink-2.3.0.v20110604-r9504

Execute the following code and getGrouList() will return a null instead of an empty list as specified by the javadoc


            CriteriaQuery<String> cquery = qbuilder.createQuery(String.class);
            Root<Customer> customer = cquery.from(Customer.class);
            EntityType<Customer> Customer_ = customer.getModel();
            EmbeddableType<Country> Country_ = mm.embeddable(Country.class);

            cquery.select(customer.get(Customer_.getSingularAttribute("country", Country.class)).get(Country_.getSingularAttribute("code", String.class)));

            List<Expression<?>> groupList = cquery.getGroupList();
            if (groupList == null) {          
                System.out.println("getGroupList returned null instead of empty list when no groupby expressions have been specified");
            }

Reproducible: Always
Comment 1 Tom Ware CLA 2012-04-05 11:01:15 EDT
Updating target milestone.
Comment 2 Tom Ware CLA 2013-02-06 11:48:07 EST
Created attachment 226644 [details]
proposed fix
Comment 3 Tom Ware CLA 2013-02-06 15:42:34 EST
Fix checked in - lazy initialization of groupBy

Reviewed by Chris Delahunt

Added test to JPA 2.1 Query test suite

Tested with JPA LRG
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:24:25 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink