DATAJPA-110 - Fixed alias detection for entity names containing numbers.
This commit is contained in:
@@ -57,7 +57,7 @@ public abstract class QueryUtils {
|
||||
private static final Pattern ALIAS_MATCH;
|
||||
private static final Pattern COUNT_MATCH;
|
||||
|
||||
private static final String IDENTIFIER = "[\\p{L}._$]+";
|
||||
private static final String IDENTIFIER = "[\\p{Alnum}._$]+";
|
||||
private static final String IDENTIFIER_GROUP = String.format("(%s)", IDENTIFIER);
|
||||
|
||||
static {
|
||||
|
||||
@@ -121,6 +121,7 @@ public class QueryUtilsUnitTests {
|
||||
assertThat(detectAlias("SELECT FROM USER U"), is("U"));
|
||||
assertThat(detectAlias("select u from User u"), IS_U);
|
||||
assertThat(detectAlias("select u from com.acme.User u"), IS_U);
|
||||
assertThat(detectAlias("select u from T05User u"), IS_U);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user