title: JPA Specification - Filter nested list object
body: <p>I have a entity <code>Order</code> with a list of tasks (another entity) and I need to use specification to filter the <code>Order</code> entity and the nested list of tasks.</p>
  <p>Example:</p>
  <pre><code>Select * Order where taks.done = &quot;S&quot;
  </code></pre>
  <p>I need to return a list of order and tasks that was done.</p>
  <p>My problem is the nested list, the specification filters only entity <code>Order</code> and not the list of tasks</p>
  <pre><code>public static Specification&lt;Order&gt; isDone(Indicator done) {
          return new JoinableSpecification&lt;&gt;() {
              @Override
              public Predicate toPredicate(Root&lt;Order&gt; root, CriteriaQuery&lt;?&gt; cq, CriteriaBuilder cb) {
                  Path&lt;Indicator&gt; path = this.joinList(root, UsuarioProcesso_.tarefas, JoinType.INNER).get(Task.done);
                  return cb.equal(path, done);
              }
          };
      }
  </code></pre>