title: QuerydslPredicateExecutor problem MongoDB-Spring
body: <p>I want to use MongoDB and  QuerydslPredicateExecutor to have custom query. I tried with the code below, but I have problem </p>
  
  <blockquote>
    <p>org.springframework.beans.factory.UnsatisfiedDependencyException:
    Error creating bean with name 'WS': Unsatisfied dependency expressed
    through field 'repository'; nested exception is
    org.springframework.beans.factory.BeanCreationException: Error
    creating bean with name 'lineeRepository': Invocation of init method
    failed; nested exception is
    org.springframework.beans.BeanInstantiationException: Failed to
    instantiate
    [org.springframework.data.mongodb.repository.support.QuerydslMongoPredicateExecutor]:
    Constructor threw exception; nested exception is
    java.lang.IllegalArgumentException: Did not find a query class
    it.polito.pedibus.Model.QFermateM for domain class
    it.polito.pedibus.Model.FermateM!</p>
  </blockquote>
  
  <p>I have this model </p>
  
  <pre><code>@Data
  @Entity
  @Document("linee")
  public class FermateM {
      @Id
      public ObjectId _id;
          private String idlinea;
          private List&lt;String&gt; fermate;
  
      }
  </code></pre>
  
  <p>With this Repository</p>
  
  <pre><code>@Repository
  public interface lineeRepository extends  MongoRepository&lt;FermateM, String&gt; , QuerydslPredicateExecutor&lt;FermateM&gt; {
      FermateM findBy_id(ObjectId _id);
      @Query( value = "{}", fields = "{idlinea : 1}" )
      List&lt;String&gt; getIDlinea();
  }
  </code></pre>
  
  <p>and this code </p>
  
  <pre><code>@Service
  @RestController
  public class WS {
  
      @Autowired
      private lineeRepository repository;
  
      @RequestMapping(value = "lines", method = RequestMethod.GET)
      public List&lt;String&gt; getIDlinee() {
          return repository.getIDlinea();
      }
  }
  </code></pre>
  
  <p>My pom file is this</p>
  
  <pre><code>    &lt;dependencies&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
              &lt;artifactId&gt;jackson-databind&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;!-- Spring boot Thymeleaf --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-thymeleaf&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-data-mongodb&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;com.mysema.querydsl&lt;/groupId&gt;
              &lt;artifactId&gt;querydsl-apt&lt;/artifactId&gt;
              &lt;version&gt;${querydsl.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;com.querydsl&lt;/groupId&gt;
              &lt;artifactId&gt;querydsl-jpa&lt;/artifactId&gt;
              &lt;version&gt;4.0.3&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.data&lt;/groupId&gt;
              &lt;artifactId&gt;spring-data-commons&lt;/artifactId&gt;
              &lt;version&gt;2.1.6.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
              &lt;version&gt;5.3.9.Final&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.projectlombok&lt;/groupId&gt;
              &lt;artifactId&gt;lombok&lt;/artifactId&gt;
              &lt;version&gt;1.18.6&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.projectlombok&lt;/groupId&gt;
              &lt;artifactId&gt;lombok&lt;/artifactId&gt;
              &lt;version&gt;1.18.6&lt;/version&gt;
          &lt;/dependency&gt;
  
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
              &lt;groupId&gt;com.mysema.maven&lt;/groupId&gt;
              &lt;artifactId&gt;apt-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;1.1.3&lt;/version&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;process&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;configuration&gt;
                          &lt;outputDirectory&gt;target/generated-sources/apt&lt;/outputDirectory&gt;
                          &lt;processor&gt;com.querydsl.apt.jpa.JPAAnnotationProcessor&lt;/processor&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>Can someone help me please?</p>