title: JPA equivalent of Hibernate's join and subselect in mapping
body: <p>Using Hibernate I can use <code>join</code> to map fields in an entity. </p>
  
  <p>-- Example --</p>
  
  <p>If I have the following class:</p>
  
  <pre><code>public class Order{
  
      private String orderNum;
  
      private String productName;
      private String productCost;
  
      private String recipientName;
      private String recipientAddress1; 
  }
  </code></pre>
  
  <p>I can map that class with the following Hibernate mapping:</p>
  
  <pre><code>&lt;class name="Order" table="order"&gt;
  
    &lt;property name="orderNum" type="java.lang.long" column="order_num" /&gt;
  
    &lt;join table="product"&gt;
  
      &lt;subselect&gt;
        SELECT o.order_id, p.name, p.cost
        FROM product p INNER JOIN order o ON o.product_id = p.product_id
      &lt;/subselect&gt;
  
      &lt;key column="order_id" /&gt;
  
      &lt;property name="productName" type="java.lang.String" column="name" /&gt;
      &lt;property name="productCost" type="java.lang.Double" column="cost" /&gt;
  
    &lt;/join&gt;
  
    &lt;join table="recipient"&gt;
  
      &lt;subselect&gt;
        SELECT o.order_id, r.name, r.address1
        FROM recipient r INNER JOIN order o ON o.recipient_id = r.recipient_id
      &lt;/subselect&gt;
  
      &lt;key column="order_id" /&gt;
  
      &lt;property name="recipientName" type="java.lang.String" column="name" /&gt;
      &lt;property name="recipientAddress1" type="java.lang.String" column="address1" /&gt;
  
    &lt;/join&gt;
  &lt;/class&gt;
  </code></pre>
  
  <p>Are there JPA annotations that give the equivalent functionality?</p>