title: JPA relation with fallback value
body: <p>I'm working with JPA and Hibernate.</p>
  
  <p>I have these tables:</p>
  
  <pre><code>ORDER
  ----------------------------
  ID | COL A | COL B | COL C |
   1 |       |       |       |
   2 |       |       |       |
  
  ORDER_FLOW
  ----------------------------
  ID | ORDER_ID | ...........|
   1 |     NULL | ...........|
   2 |        1 | ...........|
  </code></pre>
  
  <p>I'd like to generate a mapping so that the first order (order.id = 1) references the second order_flow (order_flow.id=2) and the second order (order.id = 2) fallsback to the first order_flow because of the NULL FK.</p>
  
  <p>Basically i'd like to map to a default order_flow record if does not exists a specific one.</p>
  
  <p>Is that an impossible mapping? Can someone suggest a better approach?</p>
  
  <p>Thanks in advance!</p>