org.springframework.data.mapping.PropertyReferenceException: No property created found for type
错误原因:
org.springframework.data.domain.Sort
Sort sort=new Sort(Sort.Direction.DESC,"created_time");//此处使用了数据库的字段名
public Sort(Sort.Direction direction, String... properties) {//property对应的是table orm后的Java对象的字段名
this(direction, (List)(properties == null?new ArrayList():Arrays.asList(properties)));
}
Sort sort=new Sort(Sort.Direction.DESC,"createdTime");//table表字段对应的java对象字段名
2017-01-15 20:09:26.396 DEBUG 8604 --- [nio-8080-exec-1] org.hibernate.loader.Loader : Result set row: 0
2017-01-15 20:09:26.396 DEBUG 8604 --- [nio-8080-exec-1] org.hibernate.loader.Loader : Result row:
2017-01-15 20:09:26.410 ERROR 8604 --- [nio-8080-exec-1] com.global.GlobalHandler : No property created found for type DailyNews! org.springframework.data.mapping.PropertyReferenceException: No property created found for type DailyNews!
at org.springframework.data.mapping.PropertyPath.<init>(PropertyPath.java:77) ~[spring-data-commons-1.12.6.RELEASE.jar:na]
at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:329) ~[spring-data-commons-1.12.6.RELEASE.jar:na]
at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:309) ~[spring-data-commons-1.12.6.RELEASE.jar:na]
at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:272) ~[spring-data-commons-1.12.6.RELEASE.jar:na]
at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:243) ~[spring-data-commons-1.12.6.RELEASE.jar:na]
at org.springframework.data.jpa.repository.query.QueryUtils.toJpaOrder(QueryUtils.java:542) ~[spring-data-jpa-1.10.6.RELEASE.jar:na]
at org.springframework.data.jpa.repository.query.QueryUtils.toOrders(QueryUtils.java:496) ~[spring-data-jpa-1.10.6.RELEASE.jar:na]
at org.springframework.data.jpa.repository.query.JpaQueryCreator.complete(JpaQueryCreator.java:169) ~[spring-data-jpa-1.10.6.RELEASE.jar:na]
at org.springframework.data.jpa.repository.query.JpaQueryCreator.complete(JpaQueryCreator.java:137) ~[spring-data-jpa-1.10.6.RELEASE.jar:na]
at org.springframework.data.jpa.repository.query.JpaQueryCreator.complete(JpaQueryCreator.java:49) ~[spring-data-jpa-1.10.6.RELEASE.jar:na]
at org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:88) ~[spring-data-commons-1.12.6.RELEASE.jar:na]
at org.springframework.data.jpa.repository.query.PartTreeJpaQuery$QueryPreparer.createQuery(PartTreeJpaQuery.java:136) ~[spring-data-jpa-1.10.6.RELEASE.jar:na]
at org.springframework.data.jpa.repository.query.PartTreeJpaQuery.doCreateQuery(PartTreeJpaQuery.java:78) ~[spring-data-jpa-1.10.6.RELEASE.jar:na]
at org.springframework.data.jpa.repository.query.AbstractJpaQuery.createQuery(AbstractJpaQuery.java:190) ~[spring-data-jpa-1.10.6.RELEASE.jar:na]
at org.springframework.data.jpa.repository.query.JpaQueryExecution$PagedExecution.doExecute(JpaQueryExecution.java:193) ~[spring-data-jpa-1.10.6.RELEASE.jar:na]
at org.springframework.data.jpa.repository.query.JpaQueryExecution.execute(JpaQueryExecution.java:82) ~[spring-data-jpa-1.10.6.RELEASE.jar:na]
at org.springframework.data.jpa.repository.query.AbstractJpaQuery.doExecute(AbstractJpaQuery.java:116) ~[spring-data-jpa-1.10.6.RELEASE.jar:na]
at org.springframework.data.jpa.repository.query.AbstractJpaQuery.execute(AbstractJpaQuery.java:106) ~[spring-data-jpa-1.10.6.RELEASE.jar:na]
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:482) ~[spring-data-commons-1.12.6.RELEASE.jar:na]
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:460) ~[spring-data-commons-1.12.6.RELEASE.jar:na]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:61) ~[spring-data-commons-1.12.6.RELEASE.jar:na]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) ~[spring-tx-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282) ~[spring-tx-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) ~[spring-tx-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136) ~[spring-tx-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:133) ~[spring-data-jpa-1.10.6.RELEASE.jar:na]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) ~[spring-aop-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213) ~[spring-aop-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at com.sun.proxy.$Proxy98.findByStatus(Unknown Source) ~[na:na]
org.springframework.data.mapping.PropertyReferenceException: No property created found for type的更多相关文章
- Caused by: org.springframework.data.mapping.PropertyReferenceException: No property id found for type Users!
Spring Data JPA自定义Repository Caused by: org.springframework.data.mapping.PropertyReferenceException: ...
- 在整合spring和mongodb中,提示at org.springframework.data.mapping.model.BasicPersistentEntity.findAnnotation(
遇到这种坑,找了好多资料.基本是都是因为springdata的jar包和spring的版本不兼容导致,除了这个错误之外,还有会比较多其他错误,也是版本不兼容导致的. at org.springfram ...
- springBoot JPA PageAble分页查询出错,PropertyReferenceException: No property creation found for type
PropertyReferenceException: No property creation found for type @RequestParam(required = false, defa ...
- spring data jpa 查询No property ... found for...Did you mean '...'?
原文地址:https://blog.csdn.net/earthhour/article/details/79271816 实体类字段定义: private String sku_no; dao中接口 ...
- springboot使用elasticsearch报No property index found for type错误
一.前提:项目之前使用springboot+spring-data-mongodb.现在需要加入elasticsearch做搜索引擎,这样mongo和elasticsearch共存了. 二.报错信息: ...
- jpa之No property buyerOpenId found for type OrderMaster! Did you mean 'buyerOpenid'?
java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test.conte ...
- Could not instantiate bean class [org.springframework.data.domain.Pageable]: Specified class is an interface解决方案
原文:http://pimin.net/archives/432 环境:Eclipse LUNA.Spring 4.1.1.或Spring 4.3.3.Spring Data Elasticsearc ...
- Spring Data Solr创建动态域报错:org.springframework.data.solr.UncategorizedSolrException
今天在项目中使用Spring Data Solr导入动态域数据报错, 控制台打印错误信息如下 Exception in thread "main" org.springframew ...
- 【spring data jpa】使用jpa的@Query,自己写的语句,报错:org.springframework.expression.spel.SpelEvaluationException: EL1007E: Property or field 'status' cannot be found on null
报错: org.springframework.expression.spel.SpelEvaluationException: EL1007E: Property or field 'status' ...
随机推荐
- Python基础学习1---函数
Python函数篇 函数是重用的程序选, 他们允许给一块语句一个名称,然后可以在你的程序的任何地方是使用这个名称任意多次地运行这个语句块.这个就被称为 调用 函数.比如内建了很多高效的函数 如len ...
- Using Sphinx to index CNS database
1, look at the sphinx.person.address.conf to see how to configure the conf file2, index the database ...
- select标签 样式 及文本有空格
<s:select name="codeid" id="codeid" multiple="false" list="#s ...
- POJ 2296 Map Labeler
二分答案 + 2-SAT验证,判断正方形是否相交写起来有点烦,思路还是挺简单的. #include<cstdio> #include<cstring> #include< ...
- 数据同步方案(附Java源码)
一.问题背景经常碰到要同步数据的情况,而系统自带的复制功能又不能实现增量同步,每次都要做全量复制,发生异常情况后只能重头再来,非常麻烦,优其是对那种大文件的处理,更是耗时.二.解決方案1.计算源目录数 ...
- USACO 1.3.2
题目链接:USACO 1.3.2 这道题有点小坑,不是算法错了,而是文件名,是barn1不是barnl,恕我眼拙,找了十五分钟... 肯定是木板的个数用的越多越好,这样可以减少空隙. 简单的贪心,将每 ...
- HDU 1317(Floyd判断连通性+spfa判断正环)
XYZZY Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submi ...
- VPN工作原理
引言 在过去几十年中,世界发生了很大的变化.现在很多公司除了处理本地或地区性事务外,还要考虑全球市场和物流的问题.很多公司在全国甚至全球都设有分支机构,而这些公司都需要做的一件事情就是:找到能够与分公 ...
- CodeForces 610A Pasha and Stick
#include<cstdio> #include<cstring> #include<cmath> #include<algorithm> using ...
- FMDB 查询是否存在某个表,或某个数据
//监测数据库中我要需要的表是否已经存在 NSString *existsSql = [NSString stringWithFormat:@"select count(name) as c ...