Базовый класс пользовательского репозитория + QueryDslPredicateExecutor

я нашелQueryDslPredicateExecutor очень полезен для уменьшения объема заготовки, но, кажется, бросает гаечный ключ в работу. Я сейчас пытаюсь продлитьJpaRepository с настраиваемым репозиторием базовых классов и при запуске Spring испытывает проблемы с созданием правильных экземпляров репозиториев.

//Custom base class
@NoRepositoryBean
public interface IdAwareRepository<A, ID extends Serializable> extends JpaRepository<A, ID> {
    // ID getId(A a);
}

// Base class implementation
public class IdAwareRepositoryImpl<A, ID extends Serializable>
    extends SimpleJpaRepository<A, ID> implements IdAwareRepository<A, ID>  {
    public IdAwareRepositoryImpl(JpaEntityInformation<A, ?> entityInformation, EntityManager entityManager) {
        super(entityInformation, entityManager);
    }
}

// Individual repo
@Repository
public interface MyPojoRepository extends JpaRepository<MyPojo, Integer>, QueryDslPredicateExecutor<MyPojo> {
}

// 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 {}

Я перепробовал несколько вариаций на эту тему, но мне не повезло в успешной организации. Я столкнулся с похожей проблемой на трекере Springhttps://jira.spring.io/browse/DATAJPA-674, но никаких объяснений по поводу исправления, просто этот код подвергался рефакторингу, чтобы с ним было легче работать.

Я получаю следующую ошибку:

Вызывается: org.springframework.data.mapping.PropertyReferenceException: не найдено свойство findAll для типа MyPojo! в org.springframework.data.mapping.PropertyPath. (PropertyPath.java:77) в org.springframework.data.mapping.PropertyPath.create (PropertyPath.java:329) в org.springframework.data.mapping.PropertyPath.cateate ( PropertyPath.java:309) в org.springframework.data.mapping.PropertyPath.from (PropertyPath.java:272) в org.springframework.data.mapping.PropertyPath.from (PropertyPath.java:243) в org.springframework.data .repository.query.parser.Part. (Part.java:76) в org.springframework.data.repository.query.parser.PartTree $ OrPart. (PartTree.java:235) в org.springframework.data.repository.query .parser.PartTree $ Predicate.buildTree (PartTree.java:373) в org.springframework.data.repository.query.parser.PartTree $ Predicate. (PartTree.java:353) в org.springframework.data.repository.query. Парсер ategy.resolveQuery (JpaQueryLookupStrategy.java:100) в org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy $ CreateIfNotFoundQueryLookupStrategy.resolveQueryjupjupjup AbstractQueryLookupStrategy.resolveQuery (JpaQueryLookupStrategy.java:74) в org.springframework.data.repository.core.support.RepositoryFactorySupport $ QueryExecutorMethodInterceptor. (RepositoryFactorySupport.java:206) в org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.initAndReturn (RepositoryFactoryBeanSupport.java:251) в org.springfore : 237) в org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean.afterPropertiesSet (JpaReposito ryFactoryBean.java:92) при org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods (AbstractAutowireCapableBeanFactory.java:1637) в org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean (AbstractAutowireCapableBeanFactory.java:1574)

Что для меня говорит, что Spring не может подключить как пользовательский базовый класс, так иQueryDslPredicateExecutor расширения доJpaRepository

Ответы на вопрос(1)

Ваш ответ на вопрос