title: Correctly mapping a oneToOne relation in hibernate using JPA
body: <p>I have the following two tables</p>
  
  <p>Table 1: Service:</p>
  
  <pre><code>@OneToOne(mappedBy="service")
  Routes routes;
  </code></pre>
  
  <p>Table 2: Routes:</p>
  
  <pre><code>@OneToOne(cascade= CascadeType.ALL)
      @JoinColumn(name="service_id")
      Service service;
  
      @Column(insertable = false, updatable = false)
      Long service_id;
  
      public Long getService_id() {
          return this.service_id;
      }
  
      public void setService_id() {
          this.service_id = service_id;
      }
  </code></pre>
  
  <p>I have annotated both entities as tables. I have verified that the mappedBy entity is exactly the name of the table . But I keep getting the error</p>
  
  <pre><code> @OneToOne or @ManyToOne on Service.routes references an unknown entity Routes
  </code></pre>