9 Replies Latest reply on Mar 25, 2006 10:39 AM by Emmanuel Bernard

    @PrimaryKeyJoinColumns  is disallowed annotation

    song hao Newbie

      In EJB3.0 RC5:

      public class Customer implements Serializable {
       CustomerPK customerpk;
       @PrimaryKeyJoinColumn(name = "CUSTOMERID", referencedColumnName = "ID"),
       @PrimaryKeyJoinColumn(name = "NAME", referencedColumnName = "NAME")
       private Airline airline;

      but the IDE shows me :The annotation @PrimaryKeyJoinColumns is disallowed for this location

      In ejb-3_0-pfd-spec-persistence:
      Composite foreign keys are supported by means of the PrimaryKeyJoinColumns annotation. The
      PrimaryKeyJoinColumns annotation groups PrimaryKeyJoinColumn annotations.
      Example 2: OneToOne relationship between Employee and EmployeeInfo classes
      public class EmpPK {
       public Integer id;
       public String name;
      public class Employee {
       @Id Integer id;
       @Id String name;
       @PrimaryKeyJoinColumn(name="ID", referencedColumnName="EMP_ID"),
       @PrimaryKeyJoinColumn(name="NAME", referencedColumnName="EMP_NAME")})
       EmployeeInfo info;
      public class EmployeeInfo {
       @Id @Column(name="EMP_ID")
       Integer id;
       @Id @Column(name="EMP_NAME")
       String name;

      Why disallowed?