| Summary: | TABLE_PER_CLASS-mapped key of a java.util.Map does not work for querying | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Frank Schwarz <fs5> | ||||||||||||
| Component: | Eclipselink | Assignee: | Nobody - feel free to take it <nobody> | ||||||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||||||
| Severity: | normal | ||||||||||||||
| Priority: | P3 | CC: | eclipselink.orm-inbox, guy.pelletier, tom.ware | ||||||||||||
| Version: | unspecified | ||||||||||||||
| Target Milestone: | --- | ||||||||||||||
| Hardware: | All | ||||||||||||||
| OS: | All | ||||||||||||||
| Whiteboard: | table_per_class submitted_patch | ||||||||||||||
| Attachments: |
|
||||||||||||||
Created attachment 181776 [details]
full stacktrace
Created attachment 181777 [details]
reproducer
Created attachment 181778 [details]
proposed patch
Setting target and priority. See the following page for the meanings of these fields: http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines Created attachment 183762 [details]
Final patch (includes model and testing with core fix)
Created attachment 183768 [details]
Final patch (includes model and testing with core fix)
Patch submitted. Reviewed by: Guy Pelletier, Tom Ware The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |
Build Identifier: Trunk @Entity public class DesignPattern { @ManyToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL) private Map<ProgrammingLanguage, CodeExample> codeExamples = new HashMap<ProgrammingLanguage, CodeExample>(); } @Entity public class CodeExample extends BaseEntity { } @Entity @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) public abstract class BaseEntity { } A simple query "SELECT x FROM DesignPattern x" causes: [EL Warning]: Exception [EclipseLink-6157] (Eclipse Persistence Services - @VERSION@.@QUALIFIER@): org.eclipse.persistence.exceptions.QueryException Exception Description: Element [user.test.model.CodeExample@879860] is being added to a map without a key. This generally means the database does not hold a key that is expected. Query: ReadAllQuery(name="codeExamples" referenceClass=CodeExample sql="SELECT t1.ID, t1.CONTENT, t0.codeExamples_KEY FROM DESIGNPATTERN_CODEEXAMPLE t0, CODEEXAMPLE t1 WHERE ((t0.DesignPattern_ID = ?) AND (t1.ID = t0.codeExamples_ID))") Reproducible: Always