2017-12-21 13 views
0

原因:org.springframework.data.mapping.PropertyReferenceException:タイプPersonのプロパティが見つかりません!Springboot、JPAおよびIgn

エンティティ:

@Entity 

public class Person implements Serializable { 

    /** 
    * 
    */ 
    private static final long serialVersionUID = 1L; 

    @Id 
    @GeneratedValue 
    @QuerySqlField(index = true) 
    public Long id; 


    public Long getId() { 
     return id; 
    } 

    public void setId(Long id) { 
     this.id = id; 
    } 

} 

リポジトリ

@Component 
@RepositoryConfig(cacheName = "PersonCache") 
@Repository 
public interface PersonRepository extends IgniteRepository<Person, Long> { 
    @Override 
     List<Person> findAll(); 

     @Override 
     Person findOne(Long id); 

} 

のIgnite構成:

@Bean 
    public Ignite igniteInstance() { 
     IgniteConfiguration cfg = new IgniteConfiguration(); 

     // Setting some custom name for the node. 
     cfg.setIgniteInstanceName("springDataNode"); 

     // Enabling peer-class loading feature. 
     cfg.setPeerClassLoadingEnabled(true); 

     // Defining and creating a new cache to be used by Ignite Spring Data repository. 
     CacheConfiguration ccfg = new CacheConfiguration("PersonCache"); 

     // Setting SQL schema for the cache. 
     ccfg.setIndexedTypes(Long.class, Person.class); 


     cfg.setCacheConfiguration(ccfg); 

     return Ignition.start(cfg); 
    } 

スタックトレース:

原因: org.springframework.data.mapping.PropertyReferenceException:いいえ タイプPersonのプロパティが見つかりました! org.springframework.data.mapping.PropertyPath。(PropertyPath.java:77) 〜[spring-data-commons-1.13.1.RELEASE.jar:na] org.springframework.data.mapping.PropertyPathにあります。 (PropertyPath.java:329) の場合は 〜[spring-data-commons-1.13.1.RELEASE.jar:na] org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:309) 〜 spring-data-commons-1.13.1.RELEASE.jar:na] org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:272) 〜[spring-data-commons-1.13.1.RELEASE .jar:na] org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:243) 〜[spring-data-commons-1.13.1.RELEASE.jar:na] org.springframeworkにあります。 data.repository。 (Part.java:76) 〜[spring-data-commons-1.13.1.RELEASE.jar:na] at org.springframework.data.repository.query.parser.PartTree $ OrPart。 (PartTree.java:247) 〜[spring-data-commons-1.13.1.RELEASE.jar:na] at org.springframework.data.repository.query.parser.PartTree $ Predicate.buildTree(PartTree.java:247) (PartTree.java:378) 〜[spring -data-commons-1.13.1.RELEASE.jar:na] org.springframework.data.repository.query.parser.PartTree。(PartTree.java:86) 〜[spring-data-commons-1.13.1] .RELEASE.jar:na] at org.springframework.data.jpa.repository.query.PartTreeJpaQue (PartTreeJpaQuery.java:64) 〜[spring-data-jpa-1.11.3.RELEASE.jar:na] at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy $ CreateQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy。 Javaの:103) 〜[春-データ-JPA-1.11.3.RELEASE.jar:ナ] org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy $ CreateIfNotFoundQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:214) で〜[spring-data-jpa-1.11.3.RELEASE.jar:na] at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy $ AbstractQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:77) 〜[spring-data -jpa-1.11.3.RELEASE.jar:na] at org.springframework.data.repository.core.support.RepositoryFactorySupport $ QueryExecutorMethodInterceptor (RepositoryFactorySupport.java:436) 〜[spring-data-commons-1.13.1.RELEASE.jar:na] at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:221) ) 〜[spring-data-commons-1.13.1.RELEASE.jar:na] at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.initAndReturn(RepositoryFactoryBeanSupport.java:277) 〜[spring-data -commons-1.13.1.RELEASE。jar:na] at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:263) 〜[spring-data-commons-1.13.1.RELEASE.jar:na] 組織で.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean.afterPropertiesSet(JpaRepositoryFactoryBean.java:101) 〜[spring-data-jpa-1.11.3.RELEASE.jar:na] org.springframework.beans.factoryにあります。 support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687) 〜[春豆-4.3.8.RELEASE.jar:4.3.8.RELEASE] org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactoryで.java:1624) 〜[spring-beans-4.3.8.RELEASE.jar:4.3.8.RELEASE] ... 16の共通フレーム 省略

+0

なぜあなたはPersonRepositoryを持つ必要性を感じましたか? Githubで再生器全体を共有できますか? – alamar

答えて

0

IgniteRepositoryを使用してJPAエンティティを操作しようとしているようです。

私はこれらの2人と結婚することはできないと思います。 Spring JPAは、IgniteRepositoryのカスタムメソッドをSQLに変換しようとしていますが、そうでなくてもまだ動作しません。

IgniteRepositoryは、JPA用に設計されたものではありません。

関連する問題