【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' cannot be found on null
如果检查 自己写的SQL语句完全没有问题的情况下,并且已经使用了@Param(value ="")
那么你需要注意,@Param()这个注解引入的jar包是jpa的jar包还是ibatis的jar包。
注意@Param()引用的jar包是否正确
package com.pisen.cloud.luna.ms.report.base.dao; import javax.transaction.Transactional; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying; import com.pisen.cloud.luna.ms.report.base.domain.Report;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param; public interface ReportDao extends JpaRepository<Report, Long>,JpaSpecificationExecutor<Report> { Report findByUid(String uid); @Modifying
@Transactional
int deleteByUid(String uid); @Modifying
@Transactional
@Query("update Report rp set rp.status = :#{#report.status}, " +
"rp.feedback = :#{#report.feedback} where rp.uid = :#{#report.uid}")
int update(@Param("report") Report report); }
【spring data jpa】使用jpa的@Query,自己写的语句,报错:org.springframework.expression.spel.SpelEvaluationException: EL1007E: Property or field 'status' cannot be found on null的更多相关文章
- 【spring data jpa】jpa中使用in查询或删除 在@Query中怎么写 ,报错:org.springframework.expression.spel.SpelEvaluationException: EL1007E: Property or field 'goodsConfigUid' cannot be found on null 怎么处理
示例代码如下: @Modifying @Transactional @Query("delete from GoodsBindConfigMapping gbc " + " ...
- 一步步学习 Spring Data 系列之JPA(一)
引入: Spring Data是SpringSource基金会下的一个用于简化数据库访问,并支持云服务的开源框架.其主要目标是使得数据库的访问变得方便快捷,并支持map-reduce框架和云计算数据服 ...
- 【spring boot jpa】hql语句报错 :antlr.NoViableAltException: unexpected token: roleName
使用场景:在spring data jpa下使用@Query("hql语句") 然后在项目启动的时候报错 hql语句报错:antlr.NoViableAltException: u ...
- spring jpa 实体互相引用返回restful数据循环引用报错的问题
spring jpa 实体互相引用返回restful数据循环引用报错的问题 Java实体里两个对象有关联关系,互相引用,比如,在一对多的关联关系里 Problem对象,引用了标签列表ProblemLa ...
- 【报错】spring整合activeMQ,pom.xml文件缺架包,启动报错:Caused by: java.lang.ClassNotFoundException: org.apache.xbean.spring.context.v2.XBeanNamespaceHandler
spring版本:4.3.13 ActiveMq版本:5.15 ======================================================== spring整合act ...
- Highgui.imwrite("/data/pic1111.png", mat)失败,且找不到报错
——> Highgui.imwrite("/data/pic1111.png", mat)失败,且找不到报错. ok -->直接使用以下代码,自己保存mat,从而可以跟 ...
- mysql5.7执行sql语句报错:In aggregated query without GROUP BY, expression #1 of SELECT list contains nonagg
mysql5.7执行sql语句报错:In aggregated query without GROUP BY, expression #1 of SELECT list contains nonagg ...
- 一步步学习 Spring Data 系列之JPA(二)
继上一篇文章对Spring Data JPA更深( )一步剖析. 上一篇只是简单的介绍了Spring Data JPA的简单使用,而往往在项目中这一点功能并不能满足我们的需求.这是当然的,在业务中查询 ...
- Spring Data系列之Jpa(一)
1.Spring Data的由来 Spring Data是SpringSource基金会创下的一个简化数据库访问.支持云服务的开源框架.其主要目的是让数据库访问变的方便快捷,可以用Spring Dat ...
随机推荐
- python3 time、random、hashlib模块
一.时间模块时间的几种形式:时间戳,结构化时间,字符串时间 import time print(time.time()) # 仅仅是当前时间的时间戳 float print(time.localtim ...
- Oracle基础 01 表空间 tablespace
--查看表空间 select * from dba_tablespaces; select * from v$tablespace; select * from dba_data_files; --查 ...
- 【bzoj3439】KPM的MC密码
这题乍一看后缀相等很烦的样子…… 其实如果把字符串倒过来,那么相等的后缀就可以转化成前缀,前缀相等扔进trie就可以了. 剩下无非是Trie的树链kth,主席树随便维护就好. 注意一个串彻底结束才能打 ...
- nodejs的包管理器npm和cnpm
http://www.ydcss.com/archives/18 3.npm介绍 3.1.说明:npm(node package manager)nodejs的包管理器,用于node插件管理(包括安装 ...
- webupload在IE9-出现的问题解决
1,点击选择按钮无反应 原因:IE9调用的是flash上传,Upload.swf路径错误!!导致 解决:检查Upload.swf路径是否准确!!!!直接改成cdn地址,是最直接有效的办法. 2,IE9 ...
- slatstack Master的配置
Salt系统非常简单并且易于配置,Salt系统的两个组件都有各自的配置文件.如"salt-master"是通过主配置文件来配置的,"salt-minion"是通 ...
- vim 代码片段:通过vundle插件管理器安装ultisnips |centos6.5|vim7.2
背景:中午醒来,饭都没吃,突然想到要给vim增加个代码片段的功能,因为昨天使用了gedit的代码片段,感觉不错.为什么不直接使用gedit呢?因为我相信把时间投入到vim是不会错的,精通vim就好了. ...
- 【wordpress】 $wpdb 应用实例
<?php require_once('e:/php/wordpress/wp-blog-header.php');//注释掉这一句就出错了 global $wpdb; $a = $wpdb-& ...
- CF 1003B Binary String Constructing 【构造/找规律/分类讨论】
You are given three integers a, b and x. Your task is to construct a binary string s of length n=a+b ...
- dutacm.club Water Problem(矩阵快速幂)
Water Problem Time Limit:3000/1000 MS (Java/Others) Memory Limit:163840/131072 KB (Java/Others)Tot ...