CriteriaBuilder join two tables with a custom condition
<p>I want to write this SQL query </p>

<pre><code>SELECT *  
FROM A
LEFT OUTER JOIN B
ON A.IDRESOURCE=B.IDRESOURCE AND B.IDLANGUAGE=22;
</code></pre>

<p>with the JPA Criteria Builder.
I wrote the first part of the join simply with:</p>

<pre><code>CriteriaQuery&lt;A&gt; searchQuery = criteriaBuilder.createQuery(A.class);
Root&lt;A&gt; aRoot = searchQuery.from(A.class);
Join&lt;A, B&gt; bJoin= aRoot.join("mappedB", JoinType.LEFT);
</code></pre>

<p>but I don't know how to implement the condition B.IDLANGUAGE=22.</p>

<p>Is there any way to accomplish this in Criteria Builder? </p>