Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 294266 - incorrect attribute override validation when a MapsId exists
Summary: incorrect attribute override validation when a MapsId exists
Status: VERIFIED FIXED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: General (show other bugs)
Version: 2.3   Edit
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: 2.3 M7   Edit
Assignee: Paul Fullbright CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 306777
Blocks:
  Show dependency tree
 
Reported: 2009-11-04 16:46 EST by Karen Butzke CLA
Modified: 2010-04-26 17:17 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Karen Butzke CLA 2009-11-04 16:46:26 EST
Using the JPA 2.0 spec example 1b in section 2.4.1.3

@Entity
public class Employee {
@Id long empId;
String name;
...
}
@Embeddable
public class DependentId {
String name;
long empPK; // corresponds to PK type of Employee
}
@Entity
public class Dependent {
@EmbeddedId DependentId id;
...
// id attribute mapped by join column default ("emp_empId")
@MapsId("empPK") // maps empPK attribute of embedded id
@ManyToOne Employee emp;
}

I generated tables using EclipseLink and then we were left with one incorrect validation warning on Dependent.id:
"In implied attribute override "empPK", column "empPK" cannot be resolved"

According to the spec in the EmbeddedId annotation section we should not have an implied attribute override in this case:
If the entity has a derived primary key, the AttributeOverride annotation may only be used to override those attributes of the embedded id that do not correspond to the relationship to the parent entity.
Comment 1 Paul Fullbright CLA 2010-03-29 12:49:53 EDT
resolved with bug 306777
Comment 2 Karen Butzke CLA 2010-04-26 17:17:46 EDT
verified fixed in WTP build I-3.2.0-20100422053324