title: Custom Repository Base Class + QueryDslPredicateExecutor
body: <p>I have found <code>QueryDslPredicateExecutor</code> very useful for reducing boilerplate, but it seems to be throwing a monkey wrench into the works. I'm now trying to extend <code>JpaRepository</code> with a custom base class repository, and on startup, Spring is having trouble instantiating repositories correctly.</p>
  
  <pre><code>//Custom base class
  @NoRepositoryBean
  public interface IdAwareRepository&lt;A, ID extends Serializable&gt; extends JpaRepository&lt;A, ID&gt; {
      // ID getId(A a);
  }
  
  // Base class implementation
  public class IdAwareRepositoryImpl&lt;A, ID extends Serializable&gt;
      extends SimpleJpaRepository&lt;A, ID&gt; implements IdAwareRepository&lt;A, ID&gt;  {
      public IdAwareRepositoryImpl(JpaEntityInformation&lt;A, ?&gt; entityInformation, EntityManager entityManager) {
          super(entityInformation, entityManager);
      }
  }
  
  // Individual repo
  @Repository
  public interface MyPojoRepository extends JpaRepository&lt;MyPojo, Integer&gt;, QueryDslPredicateExecutor&lt;MyPojo&gt; {
  }
  
  // Spring boot main application class
  @EnableJpaRepositories(repositoryBaseClass = IdAwareRepositoryImpl.class)
  @EntityScan(basePackageClasses = {Application.class,   Jsr310JpaConverters.class})
  @EnableAutoConfiguration(exclude = {
        org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration.class,
        org.springframework.boot.actuate.autoconfigure.ManagementWebSecurityAutoConfiguration.class})
  @SpringBootApplication
  public class Application {}
  </code></pre>
  
  <p>I've tried several variations on this theme, but have not had luck in getting things wired up successfully. I came across a similar issue on Spring's issue tracker <a href="https://jira.spring.io/browse/DATAJPA-674" rel="nofollow">https://jira.spring.io/browse/DATAJPA-674</a>, but no explanation on the fix, just that code was being refactored to be easier to work with.</p>
  
  <p>I'm getting the following error:</p>
  
  <blockquote>
    <p>Caused by:
    org.springframework.data.mapping.PropertyReferenceException: No
    property findAll found for type MyPojo!   at
    org.springframework.data.mapping.PropertyPath.(PropertyPath.java:77)
      at
    org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:329)
      at
    org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:309)
      at
    org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:272)
      at
    org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:243)
      at
    org.springframework.data.repository.query.parser.Part.(Part.java:76)
      at
    org.springframework.data.repository.query.parser.PartTree$OrPart.(PartTree.java:235)
      at
    org.springframework.data.repository.query.parser.PartTree$Predicate.buildTree(PartTree.java:373)
      at
    org.springframework.data.repository.query.parser.PartTree$Predicate.(PartTree.java:353)
      at
    org.springframework.data.repository.query.parser.PartTree.(PartTree.java:84)
      at
    org.springframework.data.jpa.repository.query.PartTreeJpaQuery.(PartTreeJpaQuery.java:62)
      at
    org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:100)
      at
    org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateIfNotFoundQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:211)
      at
    org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$AbstractQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:74)
      at
    org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.(RepositoryFactorySupport.java:416)
      at
    org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:206)
      at
    org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.initAndReturn(RepositoryFactoryBeanSupport.java:251)
      at
    org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:237)
      at
    org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean.afterPropertiesSet(JpaRepositoryFactoryBean.java:92)
      at
    org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637)
      at
    org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)</p>
  </blockquote>
  
  <p>Which to me says that Spring isn't able to wire up both the custom base class and <code>QueryDslPredicateExecutor</code> extensions to <code>JpaRepository</code></p>