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

Bug 320541

Summary: JP QL breaks when embedded values of a Map
Product: z_Archived Reporter: Michael Keith <michael.keith>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: iimuhin, jamesssss, tom.ware
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Michael Keith CLA 2010-07-21 14:30:33 EDT
Consider if Entity A has a Map of embeddable B, and B has a field called "myState". Eg:

@Entity
public class A {
   ...

   @ElementCollection
   Map<String,B> myMap;
   ...
}

@Embeddable
public class B {
  ...
  String myState;
  ...
}

then the following JP QL generates an error:

select b.myState from A a join a.myMap b where KEY(b) = 'keyString'
  
See http://hwellmann.blogspot.com/2010/07/jpa-20-querying-map.html for concrete details.
Comment 1 James Sutherland CLA 2011-11-08 13:13:30 EST
Tested it and it works now.

My guess it was the same issue preventing any element collections from working that I fixed.
Comment 2 James Sutherland CLA 2011-11-16 11:20:48 EST
See, Bug#314025
Comment 3 Eclipse Webmaster CLA 2022-06-09 10:14:23 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:24:34 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink