@@ -244,7 +244,7 @@ public void deleteAllByIdInBatch(Iterable<ID> ids) {
244
244
* Some JPA providers require {@code ids} to be a {@link Collection} so we must convert if it's not already.
245
245
*/
246
246
247
- if (Collection . class . isInstance ( ids ) ) {
247
+ if (ids instanceof Collection ) {
248
248
query .setParameter ("ids" , ids );
249
249
} else {
250
250
Collection <ID > idsCollection = StreamSupport .stream (ids .spliterator (), false )
@@ -481,12 +481,10 @@ public long delete(Specification<T> spec) {
481
481
CriteriaBuilder builder = this .entityManager .getCriteriaBuilder ();
482
482
CriteriaDelete <T > delete = builder .createCriteriaDelete (getDomainClass ());
483
483
484
- if (spec != null ) {
485
- Predicate predicate = spec .toPredicate (delete .from (getDomainClass ()), null , builder );
484
+ Predicate predicate = spec .toPredicate (delete .from (getDomainClass ()), null , builder );
486
485
487
- if (predicate != null ) {
488
- delete .where (predicate );
489
- }
486
+ if (predicate != null ) {
487
+ delete .where (predicate );
490
488
}
491
489
492
490
return this .entityManager .createQuery (delete ).executeUpdate ();
@@ -853,11 +851,13 @@ private <S> TypedQuery<S> applyRepositoryMethodMetadata(TypedQuery<S> query) {
853
851
}
854
852
855
853
LockModeType type = metadata .getLockModeType ();
856
- TypedQuery <S > toReturn = type == null ? query : query .setLockMode (type );
854
+ if (type == null ) {
855
+ query .setLockMode (type );
856
+ }
857
857
858
- applyQueryHints (toReturn );
858
+ applyQueryHints (query );
859
859
860
- return toReturn ;
860
+ return query ;
861
861
}
862
862
863
863
private void applyQueryHints (Query query ) {
0 commit comments