jpa中PropertyReferenceException: No property found for type异常原因
来源:互联网 发布:平板绘图软件 编辑:程序博客网 时间:2024/05/21 20:17
最近在使用spring data jpa的过程由于粗心的原因中遇到了一个异常,异常如下:
Caused by: org.springframework.data.mapping.PropertyReferenceException: No property saveUrl found for type SonarUrl!at org.springframework.data.mapping.PropertyPath.<init>(PropertyPath.java:77) ~[spring-data-commons-1.13.0.RELEASE.jar:na]at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:329) ~[spring-data-commons-1.13.0.RELEASE.jar:na]at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:309) ~[spring-data-commons-1.13.0.RELEASE.jar:na]at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:272) ~[spring-data-commons-1.13.0.RELEASE.jar:na]at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:243) ~[spring-data-commons-1.13.0.RELEASE.jar:na]at org.springframework.data.repository.query.parser.Part.<init>(Part.java:76) ~[spring-data-commons-1.13.0.RELEASE.jar:na]at org.springframework.data.repository.query.parser.PartTree$OrPart.<init>(PartTree.java:247) ~[spring-data-commons-1.13.0.RELEASE.jar:na]at org.springframework.data.repository.query.parser.PartTree$Predicate.buildTree(PartTree.java:398) ~[spring-data-commons-1.13.0.RELEASE.jar:na]at org.springframework.data.repository.query.parser.PartTree$Predicate.<init>(PartTree.java:378) ~[spring-data-commons-1.13.0.RELEASE.jar:na]at org.springframework.data.repository.query.parser.PartTree.<init>(PartTree.java:86) ~[spring-data-commons-1.13.0.RELEASE.jar:na]at org.springframework.data.jpa.repository.query.PartTreeJpaQuery.<init>(PartTreeJpaQuery.java:64) ~[spring-data-jpa-1.11.0.RELEASE.jar:na]at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:103) ~[spring-data-jpa-1.11.0.RELEASE.jar:na]at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateIfNotFoundQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:214) ~[spring-data-jpa-1.11.0.RELEASE.jar:na]at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$AbstractQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:77) ~[spring-data-jpa-1.11.0.RELEASE.jar:na]at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.<init>(RepositoryFactorySupport.java:436) ~[spring-data-commons-1.13.0.RELEASE.jar:na]at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:221) ~[spring-data-commons-1.13.0.RELEASE.jar:na]at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.initAndReturn(RepositoryFactoryBeanSupport.java:277) ~[spring-data-commons-1.13.0.RELEASE.jar:na]at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:263) ~[spring-data-commons-1.13.0.RELEASE.jar:na]at org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean.afterPropertiesSet(JpaRepositoryFactoryBean.java:101) ~[spring-data-jpa-1.11.0.RELEASE.jar:na]at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]... 39 common frames omittedspring data jpa中的Repository如下:
@CacheConfig(cacheNames = "urls")@Repositorypublic interface SonarUrlRepository extends JpaRepository<SonarUrl, Long> {@CachePut(key = "#p0.id")@TransactionalSonarUrl saveUrl(SonarUrl sonarUrl);}出现异常的原因是不认识saveUrl这个属性,原因如下:
1、JpaRepository中没有定义saveUrl这个方法2、该方法上面没有用@Query类似注解,如果@Query注解中的值为空,同样也会报这个异常
0 0
- jpa中PropertyReferenceException: No property found for type异常原因
- jpa PropertyReferenceException: No property user found for User异常
- Spring Data JPA 报错 :PropertyReferenceException: No property params found for type xxx!
- Spring Data Jpa 异常:PropertyReferenceException: No property xx for type yy
- org.springframework.data.mapping.PropertyReferenceException: No property name found for type User
- Spring Data JPA: No property foo found for type Bar
- Spring Data JPA - “No Property Found for Type” Exception
- Spring Data JPA: No property name found for type ×××
- Caused by: org.springframework.data.mapping.PropertyReferenceException: No property name found for t
- No property month found for type **TbExamResult**!
- PropertyReferenceException: No property
- No property sql found for type xxx.xxx.entity.UserdefinedGroup
- No property toPredicate found for type User!报错
- 另人抓狂的错误:java.lang.IllegalArgumentException: No property find found for type class
- 解决Invalid derived query! No property find found for type XX的问题
- (eclipse,myeclipse)Invalid derived query! No property delete found for type
- 解决Invalid derived query! No property find found for type XX的问题
- aop配置拦截器required type [***] for property 'myBean': no matching editors or conversion strategy found
- 前端测试
- SVN安装
- 深度优先搜索和广度优先搜索
- 2.10 随记
- ACM刷题之HDU————Children’s Queue
- jpa中PropertyReferenceException: No property found for type异常原因
- window环境下HTK下载安装
- 机器人的指令
- LeetCode Summary Linked List
- java多线程常用的类
- 全面解析Android EditText以及软键盘的设置
- Python知识点备忘(1)
- 线段树模板
- 安卓学习随笔(1)