File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 25
25
* @author Diego Krupitza
26
26
* @author Greg Turnquist
27
27
* @author Mark Paluch
28
+ * @author Aurelien Marionneau
28
29
* @since 2.7.0
29
30
*/
30
31
public final class QueryEnhancerFactory {
@@ -37,13 +38,16 @@ public final class QueryEnhancerFactory {
37
38
private static final boolean hibernatePresent = ClassUtils .isPresent ("org.hibernate.query.TypedParameterValue" ,
38
39
QueryEnhancerFactory .class .getClassLoader ());
39
40
41
+ private static final boolean hibernate5Present = ClassUtils .isPresent ("org.hibernate.jpa.TypedParameterValue" ,
42
+ QueryEnhancerFactory .class .getClassLoader ());
43
+
40
44
static {
41
45
42
46
if (jSqlParserPresent ) {
43
47
LOG .info ("JSqlParser is in classpath; If applicable, JSqlParser will be used" );
44
48
}
45
49
46
- if (hibernatePresent ) {
50
+ if (hibernatePresent || hibernate5Present ) {
47
51
LOG .info ("Hibernate is in classpath; If applicable, HQL parser will be used." );
48
52
}
49
53
}
@@ -70,7 +74,7 @@ public static QueryEnhancer forQuery(DeclaredQuery query) {
70
74
return new DefaultQueryEnhancer (query );
71
75
}
72
76
73
- return hibernatePresent ? JpaQueryEnhancer .forHql (query ) : JpaQueryEnhancer .forJpql (query );
77
+ return ( hibernatePresent || hibernate5Present ) ? JpaQueryEnhancer .forHql (query ) : JpaQueryEnhancer .forJpql (query );
74
78
}
75
79
76
80
}
You can’t perform that action at this time.
0 commit comments