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 2525 * @author Diego Krupitza
2626 * @author Greg Turnquist
2727 * @author Mark Paluch
28+ * @author Aurelien Marionneau
2829 * @since 2.7.0
2930 */
3031public final class QueryEnhancerFactory {
@@ -37,13 +38,16 @@ public final class QueryEnhancerFactory {
3738 private static final boolean hibernatePresent = ClassUtils .isPresent ("org.hibernate.query.TypedParameterValue" ,
3839 QueryEnhancerFactory .class .getClassLoader ());
3940
41+ private static final boolean hibernate5Present = ClassUtils .isPresent ("org.hibernate.jpa.TypedParameterValue" ,
42+ QueryEnhancerFactory .class .getClassLoader ());
43+
4044 static {
4145
4246 if (jSqlParserPresent ) {
4347 LOG .info ("JSqlParser is in classpath; If applicable, JSqlParser will be used" );
4448 }
4549
46- if (hibernatePresent ) {
50+ if (hibernatePresent || hibernate5Present ) {
4751 LOG .info ("Hibernate is in classpath; If applicable, HQL parser will be used." );
4852 }
4953 }
@@ -70,7 +74,7 @@ public static QueryEnhancer forQuery(DeclaredQuery query) {
7074 return new DefaultQueryEnhancer (query );
7175 }
7276
73- return hibernatePresent ? JpaQueryEnhancer .forHql (query ) : JpaQueryEnhancer .forJpql (query );
77+ return ( hibernatePresent || hibernate5Present ) ? JpaQueryEnhancer .forHql (query ) : JpaQueryEnhancer .forJpql (query );
7478 }
7579
7680}
You can’t perform that action at this time.
0 commit comments