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

Bug 355697

Summary: Map in Combination with @MapKeyColumn and enum doesn't work
Product: z_Archived Reporter: Missing name <sebastian.schneider>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P2 CC: tom.ware
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Missing name CLA 2011-08-24 08:48:03 EDT
Build Identifier: 2.1.2

@OneToMany
@JoinTable(name = "ISSUE_EMPLOYEE",
    joinColumn = @JoinColumn(name = "ISSUE_ID"),
    inverseJoinColumn = @JoinColumn("EMPLOYEE_ID"))
@MapKeyColumn(name="EMPLOYEEPOSITION_ID") 
private Map<EmployeePosition, Employee> namedEmployees = new Hashtable<EmployeePosition, Employee>();

leads to an Exception:

Internal Exception: java.sql.SQLException: ORA-00904: "EMPLOYEES": invalid identifier

Error Code: 904 Call: INSERT INTO ISSUE_EMPLOYEE (ISSUE_ID, EMPLOYEES, EMPLOYEEPOSITION_ID) VALUES (?, ?, ?) bind => [27, [B@18b85d, SERVICE]

More details:
http://stackoverflow.com/questions/4955545/jpa-map-a-mapenum-entity

Reproducible: Always

Steps to Reproduce:
1. Using MapKeyColumn with an Java enum as Key for a Map
Comment 1 Tom Ware CLA 2011-09-22 11:34:03 EDT
Setting target and priority.  See the following page for the meanings of these fields:

http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines

Community: Please vote for this bug if it is important to you.  Votes are one of the main criteria we use to determine which bugs to fix next.
Comment 2 Eclipse Webmaster CLA 2022-06-09 10:31:24 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink