File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -231,8 +231,6 @@ static class LikeParameterBinding extends ParameterBinding {
231
231
private static final List <Type > SUPPORTED_TYPES = Arrays .asList (Type .CONTAINING , Type .STARTING_WITH ,
232
232
Type .ENDING_WITH , Type .LIKE );
233
233
234
- private static final String PERCENT = "%" ;
235
-
236
234
private final Type type ;
237
235
238
236
/**
@@ -328,15 +326,11 @@ static Type getLikeTypeFrom(String expression) {
328
326
329
327
Assert .hasText (expression , "Expression must not be null or empty" );
330
328
331
- if (expression .startsWith (PERCENT ) && expression .endsWith (PERCENT )) {
332
- return Type .CONTAINING ;
333
- }
334
-
335
- if (expression .startsWith (PERCENT )) {
336
- return Type .ENDING_WITH ;
329
+ if (expression .startsWith ("%" )) {
330
+ return expression .endsWith ("%" ) ? Type .CONTAINING : Type .ENDING_WITH ;
337
331
}
338
332
339
- if (expression .endsWith (PERCENT )) {
333
+ if (expression .endsWith ("%" )) {
340
334
return Type .STARTING_WITH ;
341
335
}
342
336
You can’t perform that action at this time.
0 commit comments