@@ -299,22 +299,18 @@ public static QueryLookupStrategy create(@Nullable Key key, ApplicationEventPubl
299299 DeclaredQueryLookupStrategy declaredQueryLookupStrategy = new DeclaredQueryLookupStrategy (publisher , callbacks ,
300300 context , converter , dialect , queryMappingConfiguration , operations , beanFactory , delegate );
301301
302- Key keyToUse = key != null ? key : Key .CREATE_IF_NOT_FOUND ;
303-
304- LOG .debug (String .format ("Using the queryLookupStrategy %s" , keyToUse ));
305-
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- }
302+ CreateIfNotFoundQueryLookupStrategy createIfNotFoundQueryLookupStrategy = new CreateIfNotFoundQueryLookupStrategy (publisher , callbacks , context , converter , dialect , queryMappingConfiguration , operations , createQueryLookupStrategy ,
303+ declaredQueryLookupStrategy , delegate );
304+
305+ Key keyToUse = key != null ? key : Key .CREATE_IF_NOT_FOUND ;
306+
307+ LOG .debug (String .format ("Using the queryLookupStrategy %s" , keyToUse ));
308+
309+ return switch (keyToUse ) {
310+ case CREATE -> createQueryLookupStrategy ;
311+ case USE_DECLARED_QUERY -> declaredQueryLookupStrategy ;
312+ case CREATE_IF_NOT_FOUND -> createIfNotFoundQueryLookupStrategy ;
313+ };
318314 }
319315
320316 JdbcConverter getConverter () {
0 commit comments