【问题标题】:JPA and QueryDSL: no delete found for typeJPA 和 QueryDSL:找不到类型的删除
【发布时间】:2014-08-31 20:51:11
【问题描述】:

我只是想问一下,这一般是什么意思:

Invalid derived query! No property delete found for type:

它发生在我的类中实现 JPARepository 类(spring 框架)的方法中。我只是想了解错误的含义/试图告诉我什么。

【问题讨论】:

  • 您的查询是什么样的?您使用的是什么版本的 Spring-Data-JPA?

标签: spring-mvc jpa spring-data-jpa querydsl


【解决方案1】:

Spring Data: "delete by" is supported? 所示,您可能正在使用旧版本的 spring-jpa,它还不支持删除方法。您可以升级依赖项或为您的方法使用查询:

@Modifying
@Query("Delete from #{#entityName} t where t.userId= ?1")
public void deleteByUserId(String userId);

【讨论】:

    猜你喜欢
    • 2016-10-10
    • 1970-01-01
    • 2015-05-04
    • 2012-11-09
    • 2019-05-31
    • 2011-05-18
    • 1970-01-01
    • 1970-01-01
    • 2013-04-25
    相关资源
    最近更新 更多