99
99
public class SimpleJpaRepository <T , ID > implements JpaRepositoryImplementation <T , ID > {
100
100
101
101
private static final String ID_MUST_NOT_BE_NULL = "The given id must not be null" ;
102
+ private static final String IDS_MUST_NOT_BE_NULL = "Ids must not be null" ;
103
+ private static final String ENTITIES_MUST_NOT_BE_NULL = "Entities must not be null" ;
102
104
103
105
private final JpaEntityInformation <T , ?> entityInformation ;
104
106
private final EntityManager entityManager ;
@@ -212,7 +214,7 @@ public void delete(T entity) {
212
214
@ Transactional
213
215
public void deleteAllById (Iterable <? extends ID > ids ) {
214
216
215
- Assert .notNull (ids , "Ids must not be null" );
217
+ Assert .notNull (ids , IDS_MUST_NOT_BE_NULL );
216
218
217
219
for (ID id : ids ) {
218
220
deleteById (id );
@@ -223,7 +225,7 @@ public void deleteAllById(Iterable<? extends ID> ids) {
223
225
@ Transactional
224
226
public void deleteAllByIdInBatch (Iterable <ID > ids ) {
225
227
226
- Assert .notNull (ids , "Ids must not be null" );
228
+ Assert .notNull (ids , IDS_MUST_NOT_BE_NULL );
227
229
228
230
if (!ids .iterator ().hasNext ()) {
229
231
return ;
@@ -258,7 +260,7 @@ public void deleteAllByIdInBatch(Iterable<ID> ids) {
258
260
@ Transactional
259
261
public void deleteAll (Iterable <? extends T > entities ) {
260
262
261
- Assert .notNull (entities , "Entities must not be null" );
263
+ Assert .notNull (entities , ENTITIES_MUST_NOT_BE_NULL );
262
264
263
265
for (T entity : entities ) {
264
266
delete (entity );
@@ -269,7 +271,7 @@ public void deleteAll(Iterable<? extends T> entities) {
269
271
@ Transactional
270
272
public void deleteAllInBatch (Iterable <T > entities ) {
271
273
272
- Assert .notNull (entities , "Entities must not be null" );
274
+ Assert .notNull (entities , ENTITIES_MUST_NOT_BE_NULL );
273
275
274
276
if (!entities .iterator ().hasNext ()) {
275
277
return ;
@@ -390,7 +392,7 @@ public List<T> findAll() {
390
392
@ Override
391
393
public List <T > findAllById (Iterable <ID > ids ) {
392
394
393
- Assert .notNull (ids , "Ids must not be null" );
395
+ Assert .notNull (ids , IDS_MUST_NOT_BE_NULL );
394
396
395
397
if (!ids .iterator ().hasNext ()) {
396
398
return Collections .emptyList ();
@@ -639,7 +641,7 @@ public <S extends T> S saveAndFlush(S entity) {
639
641
@ Transactional
640
642
public <S extends T > List <S > saveAll (Iterable <S > entities ) {
641
643
642
- Assert .notNull (entities , "Entities must not be null" );
644
+ Assert .notNull (entities , ENTITIES_MUST_NOT_BE_NULL );
643
645
644
646
List <S > result = new ArrayList <>();
645
647
0 commit comments