title: How to use mappedBy with more than one value JPA
body: <p>I have 2 tables:
  Currency and Rate</p>
  
  <p>The currency's primary key is referenced by the inputCurrency and outputCurrency foreigh keys in the Rate.</p>
  
  <p>How can I map these in order to cascadeALL?</p>
  
  <p>I tried in Rate (the table that contains the foreigh keys)</p>
  
  <pre><code>@ManyToOne(cascade = CascadeType.ALL)
  @JoinColumn(name = "INPUT_CURRENCY")
  private Currency inputCurrency;
  
  @ManyToOne(cascade = CascadeType.ALL)
  @JoinColumn(name = "OUTPUT_CURRENCY")
  private Currency ouputCurrency;
  </code></pre>
  
  <p>But if I delete an item from currency It results a primary key violation.I can't remove a Currency becouse it is referenced by inputCurrency or outputCurrency in Rate.</p>
  
  <p>If I want to annotate the list of rates in Currency, how can I say mappedBy = "inputCurrency" and "outputCurrency" ?</p>
  
  <pre><code>@OneToMany(cascade = CascadeType.ALL,mappedBy ="inputCurrency,outputCurrency")
  List&lt;Rate&gt; rates;
  </code></pre>