-
1. Re: @PrimaryKeyJoinColumns is disallowed annotation
adver11 Mar 21, 2006 8:09 PM (in response to adver11)anyone can explain?
-
2. Re: @PrimaryKeyJoinColumns is disallowed annotation
adver11 Mar 22, 2006 6:57 AM (in response to adver11)nobody can explain?
-
3. Re: @PrimaryKeyJoinColumns is disallowed annotation
elkner Mar 22, 2006 7:26 AM (in response to adver11)Rough guess:
@EmbeddedId
What tables do you expect to join ? -
4. Re: @PrimaryKeyJoinColumns is disallowed annotation
adver11 Mar 22, 2006 10:24 AM (in response to adver11)Table Customer join table Airline on Customer.CUSTOMERID = Airline.ID and Customer.NAME = Airline.NAME
Customer.CUSTOMERID and Customer.NAME are complex primary key
ejb-3_0-pfd-spec-persistence, @PrimaryKeyJoinColumns Example 2:
Table Employee join table EmployeeInfo on Employee.ID = EmployeeInfo.EMP_ID and Employee.NAME = EmployeeInfo.EMP_NAME -
5. Re: @PrimaryKeyJoinColumns is disallowed annotation
elkner Mar 22, 2006 1:10 PM (in response to adver11)Hmm, actually I expected to see the Airline class. But anyway, the IDE issue might be an outdated ejb3.api beeing used. The other thing you have to find out by yourself. Just mimic the spec example and if it works, start modifying it ;-)
-
6. Re: @PrimaryKeyJoinColumns is disallowed annotation
adver11 Mar 22, 2006 8:29 PM (in response to adver11)I mimic the @PrimaryKeyJoinColumns Example 2 in ejb_3_0_pfd_spec_persistence. However, IDE(JBossIDE-1.5.1.GA) show me:The annotation @PrimaryKeyJoinColumns is disallowed for this location
I think a problem about it. -
7. Re: @PrimaryKeyJoinColumns is disallowed annotation
adver11 Mar 22, 2006 8:47 PM (in response to adver11)In ejb-3_0-pfd-spec-persistence.pdf
9.1.31 PrimaryKeyJoinColumns Annotation
@Target({TYPE}) @Retention(RUNTIME)
public @interface PrimaryKeyJoinColumns {
PrimaryKeyJoinColumn[] value();
}
It annotated @Target({TYPE}) , not @Target({TYPE,METHOD}). So, it means @PrimaryKeyJoinColumns disallowed annotated Method.Example 2: OneToOne relationship between Employee and EmployeeInfo classespublic class EmpPK { public Integer id; public String name; } @Entity @IdClass(com.acme.EmpPK.class) public class Employee { @Id Integer id; @Id String name; @OneToOne @PrimaryKeyJoinColumns ({ @PrimaryKeyJoinColumn(name="ID", referencedColumn- Name="EMP_ID"), @PrimaryKeyJoinColumn(name="NAME", referencedColumn- Name="EMP_NAME")}) EmployeeInfo info; ... } @Entity @IdClass(com.acme.EmpPK.class) public class EmployeeInfo { @Id @Column(name="EMP_ID") Integer id; @Id @Column(name="EMP_NAME") String name; ... }
but, in it's example, it can annotated Method. so i am babel. -
8. Re: @PrimaryKeyJoinColumns is disallowed annotation
elkner Mar 22, 2006 11:35 PM (in response to adver11)Now really my last post to this topic. What does your PrimaryKeyJoinColumns.class tell you ?
Something like this? Than everything should be clear.000000c0 65 74 3b 01 00 22 4c 6a 61 76 61 2f 6c 61 6e 67 |et;.."Ljava/lang| 000000d0 2f 61 6e 6e 6f 74 61 74 69 6f 6e 2f 45 6c 65 6d |/annotation/Elem| 000000e0 65 6e 74 54 79 70 65 3b 01 00 04 54 59 50 45 01 |entType;...TYPE.| 000000f0 00 20 4c 6a 61 76 61 2f 6c 61 6e 67 2f 61 6e 6e |. Ljava/lang/ann|
-
9. Re: @PrimaryKeyJoinColumns is disallowed annotation
epbernard Mar 25, 2006 10:39 AM (in response to adver11)I've added FIELD and METHOD ot the annotation target in SVN trunk