title: Spring data jpa specification criteria with complex class field
body: <p>I can write next specification:</p>
  
  <pre><code>public static Specification&lt;Order&gt; filterByDriver(Driver driver) {
      return new Specification&lt;Order&gt;() {
          @Override
          public Predicate toPredicate(Root&lt;Order&gt; root, CriteriaQuery&lt;?&gt; cq, CriteriaBuilder cb) {
              return cb.equal(root.get(Order_.driver), driver);
          }
      };
  }
  </code></pre>
  
  <p>but what if I want to find all orders for driver with name, for example  'Bob'. How can I write something like that:</p>
  
  <pre><code>public static Specification&lt;Order&gt; filterByDriverName(String driverName) {
      return new Specification&lt;Order&gt;() {
          @Override
          public Predicate toPredicate(Root&lt;Order&gt; root, CriteriaQuery&lt;?&gt; cq, CriteriaBuilder cb) {
              return cb.equal(root.get(Order_.driver.name), driverName);
          }
      };
  }
  </code></pre>
  
  <p>I am using spring-data-jpa: 1.8.0.RELEASE, please help and thanks.</p>