17
17
18
18
import static org .springframework .data .jpa .repository .query .QueryUtils .*;
19
19
20
- import java .util .*;
20
+ import java .util .ArrayList ;
21
+ import java .util .Collection ;
22
+ import java .util .Collections ;
23
+ import java .util .HashMap ;
24
+ import java .util .List ;
25
+ import java .util .Map ;
26
+ import java .util .Optional ;
21
27
import java .util .function .Function ;
22
28
23
- import javax .persistence .*;
24
- import javax .persistence .criteria .*;
29
+ import javax .persistence .EntityManager ;
30
+ import javax .persistence .LockModeType ;
31
+ import javax .persistence .NoResultException ;
32
+ import javax .persistence .Parameter ;
33
+ import javax .persistence .Query ;
34
+ import javax .persistence .TypedQuery ;
35
+ import javax .persistence .criteria .CriteriaBuilder ;
36
+ import javax .persistence .criteria .CriteriaQuery ;
37
+ import javax .persistence .criteria .ParameterExpression ;
38
+ import javax .persistence .criteria .Path ;
39
+ import javax .persistence .criteria .Predicate ;
40
+ import javax .persistence .criteria .Root ;
25
41
26
42
import org .springframework .dao .EmptyResultDataAccessException ;
27
- import org .springframework .data .domain .*;
43
+ import org .springframework .data .domain .Example ;
44
+ import org .springframework .data .domain .Page ;
45
+ import org .springframework .data .domain .PageImpl ;
46
+ import org .springframework .data .domain .Pageable ;
47
+ import org .springframework .data .domain .Sort ;
28
48
import org .springframework .data .jpa .convert .QueryByExamplePredicateBuilder ;
29
49
import org .springframework .data .jpa .domain .Specification ;
30
50
import org .springframework .data .jpa .provider .PersistenceProvider ;
@@ -307,7 +327,6 @@ public Optional<T> findById(ID id) {
307
327
/**
308
328
* Returns {@link QueryHints} with the query hints based on the current {@link CrudMethodMetadata} and potential
309
329
* {@link EntityGraph} information.
310
- *
311
330
*/
312
331
protected QueryHints getQueryHints () {
313
332
return metadata == null ? NoHints .INSTANCE : DefaultQueryHints .of (entityInformation , metadata );
@@ -537,10 +556,6 @@ public <S extends T> boolean exists(Example<S> example) {
537
556
return query .setMaxResults (1 ).getResultList ().size () == 1 ;
538
557
}
539
558
540
- /*
541
- * (non-Javadoc)
542
- * @see org.springframework.data.jpa.repository.JpaSpecificationExecutor#exists(org.springframework.data.jpa.domain.Specification)
543
- */
544
559
@ Override
545
560
public boolean exists (Specification <T > spec ) {
546
561
@@ -567,8 +582,7 @@ public <S extends T> List<S> findAll(Example<S> example) {
567
582
*/
568
583
@ Override
569
584
public <S extends T > List <S > findAll (Example <S > example , Sort sort ) {
570
- return getQuery (new ExampleSpecification <>(example , escapeCharacter ), example .getProbeType (), sort )
571
- .getResultList ();
585
+ return getQuery (new ExampleSpecification <>(example , escapeCharacter ), example .getProbeType (), sort ).getResultList ();
572
586
}
573
587
574
588
/*
0 commit comments