You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Criteria#assertNoBlankInWildcardQuery used to check if searchString contains blank.
publicCriteriastartsWith(Strings) {
Assert.notNull(s, "s may not be null");
// it should be (s, false, true)assertNoBlankInWildcardQuery(s, true, false);
queryCriteriaEntries.add(newCriteriaEntry(OperationKey.STARTS_WITH, s));
returnthis;
}
privatevoidassertNoBlankInWildcardQuery(StringsearchString, booleanleadingWildcard, booleantrailingWildcard) {
if (searchString.contains(CRITERIA_VALUE_SEPARATOR)) {
thrownewInvalidDataAccessApiUsageException("Cannot constructQuery '" + (leadingWildcard ? "*" : "") + '"'+ searchString + '"' + (trailingWildcard ? "*" : "") + "'. Use expression or multiple clauses instead.");
}
}
if call the method startsWith("a c"), it will throw InvalidDataAccessApiUsageException with message Cannot constructQuery '*"a c"'. Use expression or multiple clauses instead.
However, the message should be '"a c"*' to match the startsWith method.
The text was updated successfully, but these errors were encountered:
Criteria#assertNoBlankInWildcardQuery
used to check ifsearchString
contains blank.if call the method
startsWith("a c")
, it will throw InvalidDataAccessApiUsageException with messageCannot constructQuery '*"a c"'. Use expression or multiple clauses instead.
However, the message should be
'"a c"*'
to match thestartsWith
method.The text was updated successfully, but these errors were encountered: