Mantis - Resin
|
|||||
Viewing Issue Advanced Details | |||||
|
|||||
ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: |
3335 | major | always | 02-11-09 08:25 | 09-11-09 15:42 | |
|
|||||
Reporter: | rdhauwe | Platform: | |||
Assigned To: | ferg | OS: | |||
Priority: | normal | OS Version: | |||
Status: | closed | Product Version: | 4.0.0 | ||
Product Build: | Resolution: | fixed | |||
Projection: | none | ||||
ETA: | none | Fixed in Version: | 4.0.2 | ||
|
|||||
Summary: | 0003335: ManyToOne mapping impossible if primary key defined in super class entity | ||||
Description: |
I am using a class AbstractEntity defining the primary key of my entities: @MappedSuperclass public class AbstractEntity { private Integer id; @Id @Column(name = "ID") @GeneratedValue public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } } I don't define the primary key in entities A and B inheriting from AbstractEntity. When defining a ManyToOne relationship from B to A, Resin gives the following error message at startup/deployment: [17:21:10.156] {http--8080-15} B.getA: Number of @JoinColumns for 'a' (1) does not match the number of primary key columns for 'A' (0). The annotation is as follows on B: @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "A_ID") public A getA() { return a; } The cause seems to be the fact that the primary key of A is defined/annotated in the superclass AbstractEntity, and not in the class A itself. |
||||
Steps To Reproduce: | |||||
Additional Information: | |||||
Relationships | |||||
Attached Files: |
C:\Java\workspace\aclvb\resin\src\com\caucho\amber\cfg\AbstractRelationConfig.java [^] (8,914 bytes) 02-12-09 05:32 C:\Java\workspace\aclvb\resin\src\com\caucho\amber\field\Id.java [^] (12,241 bytes) 02-12-09 05:32 |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|