DATAJPA-1679 - Support distinct and subqueries with projections.

Original pull request: #414.
This commit is contained in:
Peter
2020-02-14 11:54:51 +01:00
committed by Jens Schauder
parent 3704b55992
commit 184757026b

View File

@@ -80,6 +80,7 @@ import org.springframework.util.StringUtils;
* @author Grégoire Druant
* @author Mohammad Hewedy
* @author Andriy Redko
* @author Peter Großmann
*/
public abstract class QueryUtils {
@@ -103,7 +104,7 @@ public abstract class QueryUtils {
private static final Pattern ALIAS_MATCH;
private static final Pattern COUNT_MATCH;
private static final Pattern PROJECTION_CLAUSE = Pattern.compile("select\\s+(.+)\\s+from", Pattern.CASE_INSENSITIVE);
private static final Pattern PROJECTION_CLAUSE = Pattern.compile("select\\s+(?:distinct\\s+)?(.+?)\\s+from", Pattern.CASE_INSENSITIVE);
private static final Pattern NO_DIGITS = Pattern.compile("\\D+");