@@ -38,9 +38,11 @@ public interface CrudRepository<T, ID> extends Repository<T, ID> {
38
38
/**
39
39
* Saves all given entities.
40
40
*
41
- * @param entities must not be {@literal null}.
42
- * @return the saved entities; will never be {@literal null}.
43
- * @throws IllegalArgumentException in case the given entity is {@literal null}.
41
+ * @param entities must not be {@literal null} nor must it contain {@literal null}
42
+ * @return the saved entities; will never be {@literal null}. The returned {@literal Iterable} will have the same size
43
+ * as the {@literal Iterable} passed as an argument.
44
+ * @throws IllegalArgumentException in case the given {@literal Iterable} or one of its contained entities is
45
+ * {@literal null}.
44
46
*/
45
47
<S extends T > Iterable <S > saveAll (Iterable <S > entities );
46
48
@@ -71,9 +73,15 @@ public interface CrudRepository<T, ID> extends Repository<T, ID> {
71
73
72
74
/**
73
75
* Returns all instances of the type with the given IDs.
76
+ * <p>
77
+ * If some or all ids are not found no entities are returned for these IDs.
78
+ * <p>
79
+ * Note that the order of elements in the result is not guaranteed.
74
80
*
75
- * @param ids
76
- * @return
81
+ * @param ids must not be {@literal null} nor contain any {@literal null} values.
82
+ * @return guaranteed to be not {@literal null}. The size will be equal or smaller than that of the argument.
83
+ * @throws IllegalArgumentException in case the given {@literal Iterable} or one of its contained entities is
84
+ * {@literal null}.
77
85
*/
78
86
Iterable <T > findAllById (Iterable <ID > ids );
79
87
@@ -95,16 +103,17 @@ public interface CrudRepository<T, ID> extends Repository<T, ID> {
95
103
/**
96
104
* Deletes a given entity.
97
105
*
98
- * @param entity
106
+ * @param entity must not be {@literal null}.
99
107
* @throws IllegalArgumentException in case the given entity is {@literal null}.
100
108
*/
101
109
void delete (T entity );
102
110
103
111
/**
104
112
* Deletes the given entities.
105
113
*
106
- * @param entities
107
- * @throws IllegalArgumentException in case the given {@link Iterable} is {@literal null}.
114
+ * @param entities must not be {@literal null}. Must not contain {@literal null} elements
115
+ * @throws IllegalArgumentException in case the given {@literal Iterable} or one of its contained entities is
116
+ * {@literal null}.
108
117
*/
109
118
void deleteAll (Iterable <? extends T > entities );
110
119
0 commit comments