Skip to content

Commit 131d17c

Browse files
committed
Polishing: JdbcQueryLookupStrategy
1 parent f3dc789 commit 131d17c

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/support/JdbcQueryLookupStrategy.java

+7-12
Original file line numberDiff line numberDiff line change
@@ -303,18 +303,13 @@ public static QueryLookupStrategy create(@Nullable Key key, ApplicationEventPubl
303303

304304
LOG.debug(String.format("Using the queryLookupStrategy %s", keyToUse));
305305

306-
switch (keyToUse) {
307-
case CREATE:
308-
return createQueryLookupStrategy;
309-
case USE_DECLARED_QUERY:
310-
return declaredQueryLookupStrategy;
311-
case CREATE_IF_NOT_FOUND:
312-
return new CreateIfNotFoundQueryLookupStrategy(publisher, callbacks, context, converter, dialect,
313-
queryMappingConfiguration, operations, createQueryLookupStrategy, declaredQueryLookupStrategy,
314-
delegate);
315-
default:
316-
throw new IllegalArgumentException(String.format("Unsupported query lookup strategy %s", key));
317-
}
306+
return switch (keyToUse) {
307+
case CREATE -> createQueryLookupStrategy;
308+
case USE_DECLARED_QUERY -> declaredQueryLookupStrategy;
309+
case CREATE_IF_NOT_FOUND -> new CreateIfNotFoundQueryLookupStrategy(
310+
publisher, callbacks, context, converter, dialect, queryMappingConfiguration, operations,
311+
createQueryLookupStrategy, declaredQueryLookupStrategy, delegate);
312+
};
318313
}
319314

320315
JdbcConverter getConverter() {

0 commit comments

Comments
 (0)