title: Java JPA Realtions
body: <p>I am doing an application where I need 2 entities: User and Car. </p>
  
  <pre><code>    public class User{
          private long id;
          private String name;
      }
  
      public class Car{
          private long id;
          private User firstUser;
          private User secondUser;
      }
  </code></pre>
  
  <p>So my table cars_info info will contain
  RENT(date), FIRST_USER(id), SECOND_USER(id)</p>
  
  <p>How do I connect this using hibernate? I need unidirectional relation. I tried OneToOne, ManyToOne but neither of that works.</p>