zoukankan      html  css  js  c++  java
  • 【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 " +
                "where gbc.goodsConfigUid = :#{#bean.goodsConfigUid}  " +
                "and  gbc.tenementId = :#{#bean.tenementId}  " +
                "and gbc.goodConfigFlag = :#{#bean.goodConfigFlag} "+
                "and gbc.goodTypeUid in (:#{#bean.goodsList})")
        int deleteByConfigUidAndTypeUid(@Param("bean") BindConfigBean bean);

    报错:

    org.springframework.expression.spel.SpelEvaluationException: EL1007E: Property or field 'goodsConfigUid' cannot be found on null

    解决方法:

    是因为在使用@Query写语句的时候,没有使用@Param()标明参数实体

  • 相关阅读:
    C:函数指针、回调函数
    C:内存分配、内存中五大区
    C:指针
    C:进制
    C:预编译指令
    C:矩形相交、相包含、相离关系判断
    C:结构体
    C:函数
    C:数组
    C: 冒泡排序
  • 原文地址:https://www.cnblogs.com/sxdcgaq8080/p/9159917.html
Copyright © 2011-2022 走看看