Skip to content

Commit 6a03dc0

Browse files
committed
HHH-18739 - Fix for hints in queries containing joins
Signed-off-by: Jan Schatteman <[email protected]>
1 parent db24cf1 commit 6a03dc0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

hibernate-core/src/main/java/org/hibernate/dialect/hint/IndexQueryHintHandler.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ public class IndexQueryHintHandler implements QueryHintHandler {
2525

2626
public static final IndexQueryHintHandler INSTANCE = new IndexQueryHintHandler();
2727

28-
private static final Pattern QUERY_PATTERN = Pattern.compile( "^\\s*(select\\b.+?\\bfrom\\b.+?)(\\bwhere\\b.+?)$" );
29-
28+
private static final Pattern QUERY_PATTERN = Pattern.compile( "^\\s*(select\\b.+?\\bfrom\\b.+?)(\\b(where|join)\\b.+?)$" );
3029
@Override
3130
public String addQueryHints(String query, String hints) {
3231
Matcher matcher = QUERY_PATTERN.matcher( query );

0 commit comments

Comments
 (0)