diff --git a/pom.xml b/pom.xml index 5ab5fafe..70eb30ef 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.data spring-data-ldap - 2.5.0-SNAPSHOT + 2.5.0-LDAP-XXX-SNAPSHOT Spring Data LDAP Spring Data integration for LDAP @@ -19,7 +19,7 @@ 2.3.3.RELEASE - 2.5.0-SNAPSHOT + 2.4.0-DATACMNS-800-SNAPSHOT spring.data.ldap diff --git a/src/main/java/org/springframework/data/ldap/repository/support/SimpleLdapRepository.java b/src/main/java/org/springframework/data/ldap/repository/support/SimpleLdapRepository.java index 2a98839f..fe3497ca 100644 --- a/src/main/java/org/springframework/data/ldap/repository/support/SimpleLdapRepository.java +++ b/src/main/java/org/springframework/data/ldap/repository/support/SimpleLdapRepository.java @@ -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; @@ -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. * @@ -56,8 +55,8 @@ public class SimpleLdapRepository implements LdapRepository { * 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 entityType) { @@ -222,9 +221,20 @@ public void delete(T entity) { */ @Override public void deleteAll(Iterable entities) { + + Assert.notNull(entities, "Entities must not be null."); + entities.forEach(this::delete); } + @Override + public void deleteAllById(Iterable names) { + + Assert.notNull(names, "Names must not be null."); + + names.forEach(this::deleteById); + } + /* (non-Javadoc) * @see org.springframework.data.repository.CrudRepository#deleteAll() */