2016-03-29 5 views
1

Ich habe gefunden QueryDslPredicateExecutor sehr nützlich, um Boilerplate zu reduzieren, aber es scheint, einen Schraubenschlüssel in die Arbeit werfen. Ich versuche jetzt, JpaRepository mit einem benutzerdefinierten Basisklassenrepository zu erweitern, und beim Start hat Spring Probleme, Instanzen ordnungsgemäß zu instanziieren.Benutzerdefinierte Repository-Basisklasse + QueryDslPredicateExecutor

Ich habe verschiedene Variationen zu diesem Thema ausprobiert, aber ich hatte kein Glück darin, Dinge erfolgreich verdrahtet zu bekommen. Ich stieß auf ein ähnliches Problem in Spring's Problem Tracker https://jira.spring.io/browse/DATAJPA-674, aber keine Erklärung auf den Fix, nur dass Code umstrukturiert wurde, um einfacher zu arbeiten.

Ich erhalte die folgende Fehlermeldung:

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)

mir, die besagen, dass der Frühling nicht in der Lage ist, sowohl die individuelle Basisklasse zu verkabeln und QueryDslPredicateExecutor Erweiterungen JpaRepository

+0

Ich treffe genau das gleiche Problem. Hast du eine Lösung gefunden? –

+0

Nein, noch nicht. Ich wollte ein kleines Projekt erstellen, das den Fehler reproduziert, um den Spring- oder Spring Data-Entwicklern einen reproduzierbaren Fehler zu geben. –

+0

Danke für die Antwort! –

Antwort

Verwandte Themen