我有实体
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
?