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

    OneToOne as primary key

    David Newbie


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

      @Id(generate = GeneratorType.NONE)
      @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.