私は、同じドメインオブジェクト上でSpring Data JPAとSpring Data Elasticsearchの両方を使用しようとしていますが、動作しません。Spring Data JPAとSpring Data Elasticsearchリポジトリの両方を、Springブートアプリケーションの同じドメインクラスにどのように使用しますか?
org.springframework.data.mapping.PropertyReferenceException::Person型が見つかりません プロパティのインデックス、私は簡単なテストを実行しようとした
は、私は次の例外を持って! org.springframework.data.mapping.PropertyPath。(PropertyPath.java:75) 〜[spring-data-commons-1.11.0.RELEASE.jar:na] at org.springframework.data.mapping.PropertyPath。 (PropertyPath.java:327) にある 〜[spring-data-commons-1.11.0.RELEASE.jar:na] org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:307) 〜 spring-data-commons-1.11.0.RELEASE.jar:na] org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:270) 〜[spring-data-commons-1.11.0.RELEASE .jar:na] org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:241) 〜[spring-data-commons-1.11.0.RELEASE.jar:na] at org.springframework。 data.repository。 (Part.java:76) 〜[spring-data-commons-1.11.0.RELEASE.jar:na] at org.springframework.data.repository.query.parser.PartTree $ OrPart。 (PartTree.java:235) 〜[spring-data-commons-1.11.0.RELEASE.jar:na] at org.springframework.data.repository.query.parser.PartTree $ Predicate.buildTree(PartTree.java:235) 373) 〜[spring-data-commons-1.11.0.RELEASE.jar:na] at org.springframework.data.repository.query.parser.PartTree $述語(PartTree.java:353) 〜[spring -data-commons-1.11.0.RELEASE.jar:na] org.springframework.data.repository.query.parser.PartTree。(PartTree.java:84) 〜[spring-data-commons-1.11.0] .RELEASE.jar:na] at org.springframework.data.jpa.repository.query.PartTreeJpaQue (PartTreeJpaQuery.java:61) 〜[spring-data-jpa-1.9.0.RELEASE.jar:na] at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy $ CreateQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy。 Javaの:95) 〜[春-データ-JPA-1.9.0.RELEASE.jar:ナ] org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy $ CreateIfNotFoundQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:206) で〜[春-データ-JPA-1.9.0.RELEASE.jar:ナ] org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy $ AbstractQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:73) 〜[春-データで-jpa-1.9.0.RELEASE.jar:na] at org.springframework.data.repository.core.support.RepositoryFactorySupport $ QueryExecutorMethodInterceptor。(Rep ositoryFactorySupport.java:408) 〜[spring-data-commons-1.11.0.RELEASE.jar:na] at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:206) 〜[spring-data-commons-1.11.0.RELEASE.jar:na] at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.initAndReturn(RepositoryFactoryBeanSupport.java:251) 〜[spring-data-commons] -1.11.0.RELEASE.jar:na] at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:237) 〜[spring-data-commons-1.11.0.RELEASE。 jar:na] at org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean.afterPropertiesSet(JpaRepositoryFactoryBean.java:92) 〜[spring-data-jpa-1.9.0.RELEASE.jar:na] at org.springframework.beans.factory.support。AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637) 〜[春豆-4.2.1.RELEASE.jar:4.2.1.RELEASE] org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.javaで:1574) 〜[春豆-4.2.1.RELEASE.jar:4.2.1.RELEASE] ... 43の共通フレーム は、いずれかを無効にするとき、彼らは仕事
を省略しました。
このプロジェクトは、Spring Boot 1.3.0.M5に基づいています。
これは、状況を再現するサンプルプロジェクトです:春データで
https://github.com/izeye/spring-boot-throwaway-branches/tree/data-jpa-and-elasticsearch
感謝。それは私が選んだ最終的な解決策へのヒントを与えました。私にとって、 'includeFilters'を使うことは、それらを別のパッケージに移動するよりも優れています。 Spring Dataのデータソースに依存しない性質は非常にいいですが、Spring Data JPAが可能であれば、 'ElasticsearchRepository'インターフェースをスキャンしなかったことはいいことでしょう。 –
私がしたことに興味のある人は、https://github.com/izeye/spring-boot-throwaway-branches/commit/874ccba09189d6ef897bc430c43b6e3705404399 –
を参照してくださいありがとうございますkenny-bastaniとjohnny-lim、私はあなたのために投票しました –