15
15
*/
16
16
package org .springframework .data .ldap .repository .support ;
17
17
18
- import static org .springframework .ldap .query .LdapQueryBuilder .*;
19
-
20
- import java .util .List ;
21
- import java .util .Optional ;
22
- import java .util .stream .Collectors ;
23
- import java .util .stream .StreamSupport ;
24
-
25
- import javax .naming .Name ;
26
-
27
18
import org .springframework .dao .EmptyResultDataAccessException ;
28
19
import org .springframework .data .domain .Persistable ;
29
20
import org .springframework .data .ldap .repository .LdapRepository ;
37
28
import org .springframework .ldap .query .LdapQuery ;
38
29
import org .springframework .util .Assert ;
39
30
31
+ import javax .naming .Name ;
32
+ import java .util .List ;
33
+ import java .util .Optional ;
34
+ import java .util .stream .Collectors ;
35
+ import java .util .stream .StreamSupport ;
36
+
37
+ import static org .springframework .ldap .query .LdapQueryBuilder .*;
38
+
40
39
/**
41
40
* Base repository implementation for LDAP.
42
41
*
@@ -56,8 +55,8 @@ public class SimpleLdapRepository<T> implements LdapRepository<T> {
56
55
* Creates a new {@link SimpleLdapRepository}.
57
56
*
58
57
* @param ldapOperations must not be {@literal null}.
59
- * @param odm must not be {@literal null}.
60
- * @param entityType must not be {@literal null}.
58
+ * @param odm must not be {@literal null}.
59
+ * @param entityType must not be {@literal null}.
61
60
*/
62
61
public SimpleLdapRepository (LdapOperations ldapOperations , ObjectDirectoryMapper odm , Class <T > entityType ) {
63
62
@@ -222,9 +221,20 @@ public void delete(T entity) {
222
221
*/
223
222
@ Override
224
223
public void deleteAll (Iterable <? extends T > entities ) {
224
+
225
+ Assert .notNull (entities , "Entities must not be null." );
226
+
225
227
entities .forEach (this ::delete );
226
228
}
227
229
230
+ @ Override
231
+ public void deleteAllById (Iterable <? extends Name > names ) {
232
+
233
+ Assert .notNull (names , "Names must not be null." );
234
+
235
+ names .forEach (this ::deleteById );
236
+ }
237
+
228
238
/* (non-Javadoc)
229
239
* @see org.springframework.data.repository.CrudRepository#deleteAll()
230
240
*/
0 commit comments