JPA Criteria API .in-Clause with empty list
<p>I use JPA Criteria API to create a query:</p>

<pre><code>    List&lt;Area&gt; areas = areaService.getAreasForUser(user);
    Join&lt;Equipment, Area&gt; areaJoin = equipment.join(Equipment_.area);
    wheres.add(areaJoin.get(Area_.id).in(areas));
</code></pre>

<p>Which means I want to get all <code>Area</code>s where a <code>User</code> has access.</p>

<p>In a <code>User</code> has <code>Area</code>s it will evaluate to <code>... where area.id IN (1, 2, 3)</code> which works fine.</p>

<p>When a <code>User</code> has no <code>Area</code>s it evaluates to: <code>... where area.id IN ()</code> which will result as error.</p>

<p>Can you give me a tip how to solve this problem?</p>

<p>Thanks</p>