title: spring-data-rest, manytomany relation with join table
body: <p>Is it possible to expose a manytomany relationship that uses a join entity (that contains extra data columns), below is my entities;</p>
  
  <p>I'm trying to get 'purchases' to show in REST, I've put in 'products' as an example of a working REST mapping;</p>
  
  <pre><code>@Entity
  public class User {
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private Long id;
  
      @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, targetEntity = Purchase.class, orphanRemoval = true)
      @JoinColumn(name = "user_id", updatable = false)
      private List&lt;Purchase&gt; purchases = new ArrayList&lt;&gt;();
  
      @ManyToMany
      @JoinColumn(name = "user_id", updatable = false)
      private List&lt;Product&gt; products = new ArrayList&lt;&gt;();
  
  }
  
  @Entity
  public class Product {
  
      @Id
      @GeneratedValue(strategy = GenerationType.AUTO)
      private Long id;
  
      private String name;
  
  }
  
  @Entity
  public class Purchase implements Serializable {
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      Long id;
  
      @ManyToOne
      @JoinColumn(name = "user_id", referencedColumnName = "id")
      private User user;
  
      @ManyToOne(targetEntity = Prodect.class)
      @JoinColumn(name = "product_id", referencedColumnName = "id")
      private Product product;
  
      @Column(name = "purchase_date")
      private Date purchaseDate;
  
  }
  </code></pre>
  
  <p>So if i send the REST call;</p>
  
  <p>[GET http://localhost:8080/webapp/users/1]</p>
  
  <p>It returns links for [http://localhost:8080/webapp/users/1/products] but not for [http://localhost:8080/webapp/users/1/purchases]</p>