Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 366061 - getGroupList() returned null instead of an empty list when no grouping expressions has been specified
Summary: getGroupList() returned null instead of an empty list when no grouping expres...
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 blocker (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-08 11:32 EST by Stephen DiMilla CLA
Modified: 2022-06-09 10:24 EDT (History)
3 users (show)

See Also:


Attachments
proposed fix (1.17 KB, patch)
2013-02-06 11:48 EST, Tom Ware CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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