title: How to set criteria fetch mode using specification in spring jpa?
body: <p>I need to implement a dynamic query and for that I'm using org.springframework.data.jpa.domain.Specification interface.
  For example:</p>
  <pre><code> public class PlayerSpecification {
  
     public static Specification&lt;Player&gt; name(String name{
          return (root, criteraQuery, criteriaBuilder)-&gt; 
              criteriaBuilder.equal(root.get(&quot;name&quot;), name);
      }
  
      public static Specification&lt;Player&gt; teamName (String teamName){
          return (root, criteraQuery, criteriaBuilder)-&gt; 
              criteriaBuilder.equal(root.get(&quot;team&quot;).get(&quot;name&quot;), teamName);
      }
  }
  </code></pre>
  <p>I would like to set JOIN FETCH in the Criteria.
  Something like:</p>
  <pre><code>criteraQuery.setFetchMode(&quot;teams&quot;, FetchMode.EAGER);
  </code></pre>
  <p>Anyone knows how to do it?</p>