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#异步
    线程同步
    线程基础
    委托,事件
    XmlSerializer
    C#接口
    C#封装
    C#多态
  • 原文地址:https://www.cnblogs.com/sxdcgaq8080/p/9159917.html
Copyright © 2011-2022 走看看