Spring数据jpa复杂请求

时间:2017-04-03 16:08:31

标签: java spring-data spring-data-jpa

我有实体

public class Event {
  private Long id;
  private String collectiveEventId;
...

一个存储库,我需要删除所有元素的方法,如果collectiveId在范围之外,而id元素除外:

public interface EventRepository extends CrudRepository<Event, Long> {
    void deleteByCollectiveEventIdInAndIdIsNot(Collection<String> collectiveEventIds, Long id);
}

我尝试过,但所有元素都被删除了(带有指定ID的元素 - 也是)。

我需要有效方法实施的帮助deleteByCollectiveEventIdInAndIdIsNot

0 个答案:

没有答案