17
17
18
18
import javax .persistence .EntityManager ;
19
19
20
- import org .slf4j .Logger ;
21
- import org .slf4j .LoggerFactory ;
22
-
23
20
import org .springframework .data .repository .query .QueryMethodEvaluationContextProvider ;
24
21
import org .springframework .data .repository .query .RepositoryQuery ;
25
22
import org .springframework .expression .spel .standard .SpelExpressionParser ;
@@ -36,7 +33,6 @@ enum JpaQueryFactory {
36
33
INSTANCE ;
37
34
38
35
private static final SpelExpressionParser PARSER = new SpelExpressionParser ();
39
- private static final Logger LOG = LoggerFactory .getLogger (JpaQueryFactory .class );
40
36
41
37
/**
42
38
* Creates a {@link RepositoryQuery} from the given {@link String} query.
@@ -48,15 +44,10 @@ enum JpaQueryFactory {
48
44
* @param evaluationContextProvider
49
45
* @return
50
46
*/
51
- @ Nullable
52
- AbstractJpaQuery fromMethodWithQueryString (JpaQueryMethod method , EntityManager em , @ Nullable String queryString ,
47
+ AbstractJpaQuery fromMethodWithQueryString (JpaQueryMethod method , EntityManager em , String queryString ,
53
48
@ Nullable String countQueryString ,
54
49
QueryMethodEvaluationContextProvider evaluationContextProvider ) {
55
50
56
- if (queryString == null ) {
57
- return null ;
58
- }
59
-
60
51
return method .isNativeQuery ()
61
52
? new NativeJpaQuery (method , em , queryString , countQueryString , evaluationContextProvider , PARSER )
62
53
: new SimpleJpaQuery (method , em , queryString , countQueryString , evaluationContextProvider , PARSER );
@@ -69,13 +60,7 @@ AbstractJpaQuery fromMethodWithQueryString(JpaQueryMethod method, EntityManager
69
60
* @param em must not be {@literal null}.
70
61
* @return
71
62
*/
72
- @ Nullable
73
63
public StoredProcedureJpaQuery fromProcedureAnnotation (JpaQueryMethod method , EntityManager em ) {
74
-
75
- if (!method .isProcedureQuery ()) {
76
- return null ;
77
- }
78
-
79
64
return new StoredProcedureJpaQuery (method , em );
80
65
}
81
66
}
0 commit comments