zoukankan      html  css  js  c++  java
  • 【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);
    
    }
  • 相关阅读:
    学习笔记25—python基本运算法则
    学习笔记24—win10环境下python版libsvm的安装
    学习笔记23—window10 64位 python2.7 安装liblinear
    学习笔记22—PS小技巧
    学习笔记21—PS换图片背景
    学习笔记20—MATLAB特殊函数
    学习笔记19—dpabi错误集
    学习笔记18—circos应用集
    system
    Python string
  • 原文地址:https://www.cnblogs.com/sxdcgaq8080/p/9176319.html
Copyright © 2011-2022 走看看