title: JPA one-many gives null value after mapping
body: <p>Could someone point out what I am doing wrong (followup on earlier question)?</p>
  
  <p>I have three classes: Dashboard, DashboardUser and User.</p>
  
  <p>Dashboard works fine, with the following code:</p>
  
  <pre><code> @OneToMany(cascade= CascadeType.ALL, orphanRemoval = true, mappedBy="dashboard")
      private List&lt;DashboardUser&gt; dashboardUsers = new ArrayList&lt;&gt;();
  </code></pre>
  
  <p>DashboardUser contains the following two JPA declarations:</p>
  
  <pre><code>    @Id
      @ManyToOne(fetch=FetchType.LAZY)
      @JoinColumn(name = "IDUser")
      private User user;
  
      @Id
      @ManyToOne(fetch=FetchType.LAZY)
      @JoinColumn(name = "IDDashboard")
      private Dashboard dashboard;
  </code></pre>
  
  <p>The problem lies with User.java:</p>
  
  <pre><code>@OneToMany(cascade= CascadeType.ALL, orphanRemoval = true, mappedBy="user")
      private List&lt;DashboardUser&gt; dashboardUsers;
  </code></pre>
  
  <p>It looks the same, but only the Dashboard class works as it should.
  After executing my code, my dashboard has a dashboardUser among his attributes, the user however has a null value for dashboardUser. </p>
  
  <p>The table in the database has two fields: IDUser and IDDashboard (I do use the right userID and dashboardID). Does someone see my mistake?</p>