Skip to content

DATALDAP-181 - Implement CrudRepository.delete(Iterable<ID> ids). #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>org.springframework.data</groupId>
<artifactId>spring-data-ldap</artifactId>
<version>2.5.0-SNAPSHOT</version>
<version>2.5.0-LDAP-XXX-SNAPSHOT</version>

<name>Spring Data LDAP</name>
<description>Spring Data integration for LDAP</description>
Expand All @@ -19,7 +19,7 @@

<properties>
<spring-ldap>2.3.3.RELEASE</spring-ldap>
<springdata.commons>2.5.0-SNAPSHOT</springdata.commons>
<springdata.commons>2.4.0-DATACMNS-800-SNAPSHOT</springdata.commons>
<java-module-name>spring.data.ldap</java-module-name>
</properties>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,6 @@
*/
package org.springframework.data.ldap.repository.support;

import static org.springframework.ldap.query.LdapQueryBuilder.*;

import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.stream.StreamSupport;

import javax.naming.Name;

import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.data.domain.Persistable;
import org.springframework.data.ldap.repository.LdapRepository;
Expand All @@ -37,6 +28,14 @@
import org.springframework.ldap.query.LdapQuery;
import org.springframework.util.Assert;

import javax.naming.Name;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.stream.StreamSupport;

import static org.springframework.ldap.query.LdapQueryBuilder.*;

/**
* Base repository implementation for LDAP.
*
Expand All @@ -56,8 +55,8 @@ public class SimpleLdapRepository<T> implements LdapRepository<T> {
* Creates a new {@link SimpleLdapRepository}.
*
* @param ldapOperations must not be {@literal null}.
* @param odm must not be {@literal null}.
* @param entityType must not be {@literal null}.
* @param odm must not be {@literal null}.
* @param entityType must not be {@literal null}.
*/
public SimpleLdapRepository(LdapOperations ldapOperations, ObjectDirectoryMapper odm, Class<T> entityType) {

Expand Down Expand Up @@ -222,9 +221,20 @@ public void delete(T entity) {
*/
@Override
public void deleteAll(Iterable<? extends T> entities) {

Assert.notNull(entities, "Entities must not be null.");

entities.forEach(this::delete);
}

@Override
public void deleteAllById(Iterable<? extends Name> names) {

Assert.notNull(names, "Names must not be null.");

names.forEach(this::deleteById);
}

/* (non-Javadoc)
* @see org.springframework.data.repository.CrudRepository#deleteAll()
*/
Expand Down