1 Reply Latest reply on Sep 30, 2005 6:35 AM by epbernard

    OneToOne as primary key

    infodavid

      Hello,

      I want to use the primary key of an entity as primary key, like :

      @Id(generate = GeneratorType.NONE)
      @NotNull
      @OneToOne(fetch = FetchType.LAZY, targetEntity = Company.class)
      @JoinColumn(name = "details_id", nullable = false, unique = true)
      public ICompany getCompany() throws RemoteException {
      return company;
      }
      
      public void setCompany(ICompany o) throws RemoteException {
      company = o;
      }


      but with this code, hibernate use the 'ICompany' value and not it's primary key.