title: Right join in jpa
body: <p><strong>NewRequest.java</strong></p>
  
  <pre><code>@Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  @Basic(optional = false)
  @Column(nullable = false)
  private Long id;
  
  @Size(max = 2147483647)
  @Column(length = 2147483647)
  private String data;
  
  @JoinColumn(name = "buyer_id", referencedColumnName = "id")
  @ManyToOne(fetch = FetchType.LAZY)
  private Buyer buyer_id;
  
  @OneToMany(mappedBy = "newrequest_id", fetch = FetchType.LAZY)
  private Collection&lt;Mapping&gt; mappingCollection;  
  </code></pre>
  
  <p><strong>Mapping.java</strong></p>
  
  <pre><code>@Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  @Basic(optional = false)
  @Column(nullable = false)
  private Long id;
  
  @JoinColumn(name = "seller_id", referencedColumnName = "id")
  @ManyToOne(fetch = FetchType.LAZY)
  private Seller seller_id;
  
  @JoinColumn(name = "newrequest_id", referencedColumnName = "id")
  @ManyToOne(fetch = FetchType.LAZY)
  private NewRequest newrequest_id;
  </code></pre>
  
  <p>Lets say, I have records something like this.</p>
  
  <p><strong>new_request :</strong></p>
  
  <pre><code>id(PK) |  data  | buyer_id(FK)
  ------------------------------
  1      |  data1 |   1
  2      |  data2 |   1
  3      |  data3 |   2
  </code></pre>
  
  <p><strong>mapping :</strong></p>
  
  <pre><code>id(PK) | newrequest_id(FK) | seller_id(FK)
  ------------------------------------------
  1      |        1          |    1
  </code></pre>
  
  <p>Note : consider buyer and seller two different table exist.</p>
  
  <p>I want all new_request which is mapped with seller or not. So, expected Output : </p>
  
  <pre><code>id   | data  | buyer_id | seller_id
  ------------------------------------
  1    | data1 |  1       |    1
  2    | data2 |  1       |
  3    | data3 |  2       |
  </code></pre>
  
  <p>I tried below query in JPA :</p>
  
  <pre><code>select n.id,n.data,n.buyer_id,m.seller_id from Mapping m left join m.newrequest_id n 
  </code></pre>
  
  <p>which gives only one data (output row no 1). </p>
  
  <p>I got my result with right join using native query. But I want to achieve it using JPA query.</p>