Skip to content

Instantly share code, notes, and snippets.

@thomasdarimont
Created August 27, 2013 11:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomasdarimont/6352513 to your computer and use it in GitHub Desktop.
Save thomasdarimont/6352513 to your computer and use it in GitHub Desktop.
Prototypic fix / test case for https://jira.springsource.org/browse/DATACMNS-363
//In org.springframework.data.repository.query.parser.
private static final Pattern PREFIX_TEMPLATE = Pattern
.compile("^(find|read|get|count)((\\p{Lu}|\\P{M}\\p{M}*+).*?)??By");
private static final String KEYWORD_TEMPLATE = "(%s)(?=(\\p{Lu}|\\P{M}\\p{M}*+))";
//In org.springframework.data.repository.query.parser.PartTreeUnitTests
/**
* @see DATACMNS-363
*/
@Test
public void supportNonLowercaseUnicodeAttributeNamesInQueryMethodNames() throws Exception {
PartTree tree = new PartTree("findBy생일And이름", DomainObjectWithSpecialChars.class);
assertPart(tree, new Part[] { new Part("생일", DomainObjectWithSpecialChars.class),
new Part("이름", DomainObjectWithSpecialChars.class) });
}
//...
class DomainObjectWithSpecialChars {
String øre;
String år;
String 생일; // Birthday
String 이름; // Name
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment