diff --git a/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/query/AbstractDelegatingRowMapper.java b/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/query/AbstractDelegatingRowMapper.java index 371fa7736..7bbeb88dc 100644 --- a/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/query/AbstractDelegatingRowMapper.java +++ b/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/query/AbstractDelegatingRowMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2025 the original author or authors. + * Copyright 2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,32 +23,38 @@ import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** - * Abstract {@link RowMapper} that delegates the actual mapping logic to a {@link AbstractDelegatingRowMapper#delegate delegate} + * Abstract {@link RowMapper} that delegates the actual mapping logic to a {@link AbstractDelegatingRowMapper#delegate + * delegate} * * @author Mikhail Polivakha + * @since 4.0 */ public abstract class AbstractDelegatingRowMapper implements RowMapper { - private final RowMapper delegate; + private final RowMapper delegate; - protected AbstractDelegatingRowMapper(RowMapper delegate) { - Assert.notNull(delegate, "Delegating RowMapper cannot be null"); + protected AbstractDelegatingRowMapper(RowMapper delegate) { - this.delegate = delegate; - } + Assert.notNull(delegate, "Delegating RowMapper cannot be null"); - @Override - public T mapRow(ResultSet rs, int rowNum) throws SQLException { - T intermediate = delegate.mapRow(rs, rowNum); - return postProcessMapping(intermediate); - } + this.delegate = delegate; + } - /** - * The post-processing callback for implementations. - * - * @return the mapped entity after applying post-processing logic - */ - protected T postProcessMapping(@Nullable T object) { - return object; - } + @Override + @Nullable + public T mapRow(ResultSet rs, int rowNum) throws SQLException { + + T intermediate = delegate.mapRow(rs, rowNum); + return postProcessMapping(intermediate); + } + + /** + * The post-processing callback for implementations. + * + * @return the mapped entity after applying post-processing logic + */ + @Nullable + protected T postProcessMapping(@Nullable T object) { + return object; + } } diff --git a/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/query/AbstractJdbcQuery.java b/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/query/AbstractJdbcQuery.java index ca236e528..0ef27d3f6 100644 --- a/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/query/AbstractJdbcQuery.java +++ b/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/query/AbstractJdbcQuery.java @@ -15,8 +15,6 @@ */ package org.springframework.data.jdbc.repository.query; -import java.sql.ResultSet; -import java.sql.SQLException; import java.util.List; import java.util.function.Supplier; import java.util.stream.Stream; @@ -156,7 +154,7 @@ public abstract class AbstractJdbcQuery implements RepositoryQuery { * @deprecated Use {@link org.springframework.data.jdbc.repository.query.RowMapperFactory} instead */ @Deprecated(forRemoval = true, since = "3.4.4") - public interface RowMapperFactory extends org.springframework.data.jdbc.repository.query.RowMapperFactory { } + public interface RowMapperFactory extends org.springframework.data.jdbc.repository.query.RowMapperFactory {} /** * Delegating {@link RowMapper} that reads a row into {@code T} and converts it afterwards into {@code Object}. @@ -166,8 +164,8 @@ public abstract class AbstractJdbcQuery implements RepositoryQuery { * @deprecated use {@link org.springframework.data.jdbc.repository.query.ConvertingRowMapper} instead */ @Deprecated(forRemoval = true, since = "3.4.4") - protected static class ConvertingRowMapper extends - org.springframework.data.jdbc.repository.query.ConvertingRowMapper { + protected static class ConvertingRowMapper + extends org.springframework.data.jdbc.repository.query.ConvertingRowMapper { @SuppressWarnings("unchecked") public ConvertingRowMapper(RowMapper delegate, Converter converter) { diff --git a/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/query/CallbackCapableRowMapper.java b/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/query/CallbackCapableRowMapper.java index 69165653d..3b43091ff 100644 --- a/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/query/CallbackCapableRowMapper.java +++ b/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/query/CallbackCapableRowMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2025 the original author or authors. + * Copyright 2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,35 +25,41 @@ import org.springframework.jdbc.core.RowMapper; import org.springframework.lang.Nullable; /** - * Delegating {@link RowMapper} implementation that applies post-processing logic - * after the {@link RowMapper#mapRow(ResultSet, int)}. In particular, it emits the - * {@link AfterConvertEvent} event and invokes the {@link AfterConvertCallback} callbacks. + * Delegating {@link RowMapper} implementation that applies post-processing logic after the + * {@link RowMapper#mapRow(ResultSet, int)}. In particular, it emits the {@link AfterConvertEvent} event and invokes the + * {@link AfterConvertCallback} callbacks. * * @author Mark Paluch * @author Mikhail Polivakha + * @since 4.0 */ public class CallbackCapableRowMapper extends AbstractDelegatingRowMapper { - private final ApplicationEventPublisher publisher; - private final @Nullable EntityCallbacks callbacks; + private final ApplicationEventPublisher publisher; + private final @Nullable EntityCallbacks callbacks; - public CallbackCapableRowMapper(RowMapper delegate, ApplicationEventPublisher publisher, @Nullable EntityCallbacks callbacks) { - super(delegate); - this.publisher = publisher; - this.callbacks = callbacks; - } + public CallbackCapableRowMapper(RowMapper delegate, ApplicationEventPublisher publisher, + @Nullable EntityCallbacks callbacks) { - @Override - public T postProcessMapping(@Nullable T object) { - if (object != null) { + super(delegate); - publisher.publishEvent(new AfterConvertEvent<>(object)); + this.publisher = publisher; + this.callbacks = callbacks; + } - if (callbacks != null) { - return callbacks.callback(AfterConvertCallback.class, object); - } + @Override + @Nullable + public T postProcessMapping(@Nullable T object) { - } - return object; - } + if (object != null) { + + publisher.publishEvent(new AfterConvertEvent<>(object)); + + if (callbacks != null) { + return callbacks.callback(AfterConvertCallback.class, object); + } + + } + return object; + } } diff --git a/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/query/ConvertingRowMapper.java b/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/query/ConvertingRowMapper.java index 2f3c6e6da..0efc660e0 100644 --- a/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/query/ConvertingRowMapper.java +++ b/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/query/ConvertingRowMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2025 the original author or authors. + * Copyright 2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,24 +20,26 @@ import org.springframework.jdbc.core.RowMapper; import org.springframework.lang.Nullable; /** - * Delegating {@link RowMapper} that reads a row into {@code T} and converts it afterwards into {@code Object}. + * Delegating {@link RowMapper} that reads a row into {@code T} and converts it afterward into {@code Object}. * * @author Mark Paluch * @author Mikhail Polivakha - * - * @since 2.3 + * @since 4.0 */ public class ConvertingRowMapper extends AbstractDelegatingRowMapper { - private final Converter converter; + private final Converter converter; + + public ConvertingRowMapper(RowMapper delegate, Converter converter) { + + super(delegate); - public ConvertingRowMapper(RowMapper delegate, Converter converter) { - super(delegate); - this.converter = converter; - } + this.converter = converter; + } - @Override - public Object postProcessMapping(@Nullable Object object) { - return object != null ? converter.convert(object) : null; - } + @Override + @Nullable + public Object postProcessMapping(@Nullable Object object) { + return object != null ? converter.convert(object) : null; + } } diff --git a/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/query/DefaultRowMapperFactory.java b/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/query/DefaultRowMapperFactory.java index 06a7cc183..d7267b385 100644 --- a/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/query/DefaultRowMapperFactory.java +++ b/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/query/DefaultRowMapperFactory.java @@ -27,64 +27,63 @@ import org.springframework.jdbc.core.RowMapper; import org.springframework.jdbc.core.SingleColumnRowMapper; /** - * Default implementation of {@link RowMapperFactory}. Honors the custom mappings defined - * in {@link QueryMappingConfiguration}. + * Default implementation of {@link RowMapperFactory}. Honors the custom mappings defined in + * {@link QueryMappingConfiguration}. *

- * This implementation is not capable of loading the {@link RowMapper} or {@link ResultSetExtractor} - * by reference via corresponding methods from {@link RowMapperFactory}. + * This implementation is not capable of loading the {@link RowMapper} or {@link ResultSetExtractor} by reference via + * corresponding methods from {@link RowMapperFactory}. * * @implNote Public APIs of this class are thread-safe. * @author Mikhail Polivakha + * @since 4.0 */ public class DefaultRowMapperFactory implements RowMapperFactory { - private final RelationalMappingContext context; - private final JdbcConverter converter; - private final QueryMappingConfiguration queryMappingConfiguration; - private final EntityCallbacks entityCallbacks; - private final ApplicationEventPublisher publisher; + private final RelationalMappingContext context; + private final JdbcConverter converter; + private final QueryMappingConfiguration queryMappingConfiguration; + private final EntityCallbacks entityCallbacks; + private final ApplicationEventPublisher publisher; - public DefaultRowMapperFactory( - RelationalMappingContext context, - JdbcConverter converter, - QueryMappingConfiguration queryMappingConfiguration, - EntityCallbacks entityCallbacks, - ApplicationEventPublisher publisher - ) { - this.context = context; - this.converter = converter; - this.queryMappingConfiguration = queryMappingConfiguration; - this.entityCallbacks = entityCallbacks; - this.publisher = publisher; - } + public DefaultRowMapperFactory(RelationalMappingContext context, JdbcConverter converter, + QueryMappingConfiguration queryMappingConfiguration, EntityCallbacks entityCallbacks, + ApplicationEventPublisher publisher) { - @Override - @SuppressWarnings("unchecked") - public RowMapper create(Class returnedObjectType) { + this.context = context; + this.converter = converter; + this.queryMappingConfiguration = queryMappingConfiguration; + this.entityCallbacks = entityCallbacks; + this.publisher = publisher; + } - RelationalPersistentEntity persistentEntity = context.getPersistentEntity(returnedObjectType); + @Override + @SuppressWarnings("unchecked") + public RowMapper create(Class returnedObjectType) { - if (persistentEntity == null) { - return (RowMapper) SingleColumnRowMapper.newInstance(returnedObjectType, - converter.getConversionService()); - } + RelationalPersistentEntity persistentEntity = context.getPersistentEntity(returnedObjectType); - return (RowMapper) determineDefaultMapper(returnedObjectType); - } + if (persistentEntity == null) { - private RowMapper determineDefaultMapper(Class returnedObjectType) { + return (RowMapper) SingleColumnRowMapper.newInstance(returnedObjectType, + converter.getConversionService()); + } - RowMapper configuredQueryMapper = queryMappingConfiguration.getRowMapper(returnedObjectType); + return (RowMapper) determineDefaultMapper(returnedObjectType); + } - if (configuredQueryMapper != null) { - return configuredQueryMapper; - } + private RowMapper determineDefaultMapper(Class returnedObjectType) { - EntityRowMapper defaultEntityRowMapper = new EntityRowMapper<>( // - context.getRequiredPersistentEntity(returnedObjectType), // - converter // - ); + RowMapper configuredQueryMapper = queryMappingConfiguration.getRowMapper(returnedObjectType); - return new CallbackCapableRowMapper<>(defaultEntityRowMapper, publisher, entityCallbacks); - } + if (configuredQueryMapper != null) { + return configuredQueryMapper; + } + + EntityRowMapper defaultEntityRowMapper = new EntityRowMapper<>( // + context.getRequiredPersistentEntity(returnedObjectType), // + converter // + ); + + return new CallbackCapableRowMapper<>(defaultEntityRowMapper, publisher, entityCallbacks); + } } diff --git a/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/query/PartTreeJdbcQuery.java b/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/query/PartTreeJdbcQuery.java index 1d542a74f..c096c47de 100644 --- a/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/query/PartTreeJdbcQuery.java +++ b/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/query/PartTreeJdbcQuery.java @@ -97,7 +97,8 @@ public class PartTreeJdbcQuery extends AbstractJdbcQuery { * @since 2.3 */ public PartTreeJdbcQuery(RelationalMappingContext context, JdbcQueryMethod queryMethod, Dialect dialect, - JdbcConverter converter, NamedParameterJdbcOperations operations, org.springframework.data.jdbc.repository.query.RowMapperFactory rowMapperFactory) { + JdbcConverter converter, NamedParameterJdbcOperations operations, + org.springframework.data.jdbc.repository.query.RowMapperFactory rowMapperFactory) { super(queryMethod, operations); @@ -160,13 +161,13 @@ public class PartTreeJdbcQuery extends AbstractJdbcQuery { JdbcQueryExecution queryExecution = getJdbcQueryExecution(extractor, rowMapper); if (getQueryMethod().isSliceQuery()) { - //noinspection unchecked + // noinspection unchecked return new SliceQueryExecution<>((JdbcQueryExecution>) queryExecution, accessor.getPageable()); } if (getQueryMethod().isPageQuery()) { - //noinspection unchecked + // noinspection unchecked return new PageQueryExecution<>((JdbcQueryExecution>) queryExecution, accessor.getPageable(), () -> { @@ -291,7 +292,8 @@ public class PartTreeJdbcQuery extends AbstractJdbcQuery { private final Lazy> rowMapper; private final Function> rowMapperFunction; - public CachedRowMapperFactory(PartTree tree, org.springframework.data.jdbc.repository.query.RowMapperFactory rowMapperFactory, RelationalConverter converter, + public CachedRowMapperFactory(PartTree tree, + org.springframework.data.jdbc.repository.query.RowMapperFactory rowMapperFactory, RelationalConverter converter, ResultProcessor defaultResultProcessor) { this.rowMapperFunction = processor -> { @@ -301,8 +303,8 @@ public class PartTreeJdbcQuery extends AbstractJdbcQuery { } Converter resultProcessingConverter = new ResultProcessingConverter(processor, converter.getMappingContext(), converter.getEntityInstantiators()); - return new org.springframework.data.jdbc.repository.query.ConvertingRowMapper(rowMapperFactory.create(processor.getReturnedType().getDomainType()), - resultProcessingConverter); + return new org.springframework.data.jdbc.repository.query.ConvertingRowMapper( + rowMapperFactory.create(processor.getReturnedType().getDomainType()), resultProcessingConverter); }; this.rowMapper = Lazy.of(() -> this.rowMapperFunction.apply(defaultResultProcessor)); diff --git a/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/query/RowMapperFactory.java b/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/query/RowMapperFactory.java index 9a93d5634..d30b2edbf 100644 --- a/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/query/RowMapperFactory.java +++ b/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/query/RowMapperFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2025 the original author or authors. + * Copyright 2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,36 +23,35 @@ import org.springframework.jdbc.core.RowMapper; * * @author Jens Schauder * @author Mikhail Polivakha - * - * @since 2.3 + * @since 4.0 */ public interface RowMapperFactory { - /** - * Obtain a {@link RowMapper} based on the expected return type passed in as an argument. - * - * @param result must not be {@code null}. - * @return a {@code RowMapper} producing instances of {@code result}. - */ - RowMapper create(Class result); + /** + * Obtain a {@link RowMapper} based on the expected return type passed in as an argument. + * + * @param result must not be {@code null}. + * @return a {@code RowMapper} producing instances of {@code result}. + */ + RowMapper create(Class result); - /** - * Obtain a {@link RowMapper} from some other source, typically a {@link org.springframework.beans.factory.BeanFactory}. - * - * @param reference must not be {@code null}. - * @since 3.4 - */ - default RowMapper getRowMapper(String reference) { - throw new UnsupportedOperationException("getRowMapper by reference is not supported"); - } + /** + * Obtain a {@link RowMapper} from some other source, typically a + * {@link org.springframework.beans.factory.BeanFactory}. + * + * @param reference must not be {@code null}. + */ + default RowMapper getRowMapper(String reference) { + throw new UnsupportedOperationException("getRowMapper by reference is not supported"); + } - /** - * Obtain a {@code ResultSetExtractor} from some other source, typically a {@link org.springframework.beans.factory.BeanFactory}. - * - * @param reference must not be {@code null}. - * @since 3.4 - */ - default ResultSetExtractor getResultSetExtractor(String reference) { - throw new UnsupportedOperationException("getResultSetExtractor by reference is not supported"); - } + /** + * Obtain a {@code ResultSetExtractor} from some other source, typically a + * {@link org.springframework.beans.factory.BeanFactory}. + * + * @param reference must not be {@code null}. + */ + default ResultSetExtractor getResultSetExtractor(String reference) { + throw new UnsupportedOperationException("getResultSetExtractor by reference is not supported"); + } } diff --git a/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/query/StringBasedJdbcQuery.java b/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/query/StringBasedJdbcQuery.java index fc18f2978..b9f92fc79 100644 --- a/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/query/StringBasedJdbcQuery.java +++ b/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/query/StringBasedJdbcQuery.java @@ -95,7 +95,8 @@ public class StringBasedJdbcQuery extends AbstractJdbcQuery { * @since 3.4 */ public StringBasedJdbcQuery(JdbcQueryMethod queryMethod, NamedParameterJdbcOperations operations, - org.springframework.data.jdbc.repository.query.RowMapperFactory rowMapperFactory, JdbcConverter converter, ValueExpressionDelegate delegate) { + org.springframework.data.jdbc.repository.query.RowMapperFactory rowMapperFactory, JdbcConverter converter, + ValueExpressionDelegate delegate) { this(queryMethod.getRequiredQuery(), queryMethod, operations, rowMapperFactory, converter, delegate); } @@ -112,7 +113,8 @@ public class StringBasedJdbcQuery extends AbstractJdbcQuery { * @since 3.4 */ public StringBasedJdbcQuery(String query, JdbcQueryMethod queryMethod, NamedParameterJdbcOperations operations, - org.springframework.data.jdbc.repository.query.RowMapperFactory rowMapperFactory, JdbcConverter converter, ValueExpressionDelegate delegate) { + org.springframework.data.jdbc.repository.query.RowMapperFactory rowMapperFactory, JdbcConverter converter, + ValueExpressionDelegate delegate) { super(queryMethod, operations); Assert.hasText(query, "Query must not be null or empty"); Assert.notNull(rowMapperFactory, "RowMapperFactory must not be null"); diff --git a/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/support/JdbcQueryLookupStrategy.java b/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/support/JdbcQueryLookupStrategy.java index e47743179..cb3d2fb3b 100644 --- a/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/support/JdbcQueryLookupStrategy.java +++ b/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/support/JdbcQueryLookupStrategy.java @@ -109,10 +109,10 @@ abstract class JdbcQueryLookupStrategy extends RelationalQueryLookupStrategy { QueryMappingConfiguration queryMappingConfiguration, NamedParameterJdbcOperations operations, ValueExpressionDelegate delegate) { - super(publisher, callbacks, context, converter, dialect, queryMappingConfiguration, operations, - delegate); + super(publisher, callbacks, context, converter, dialect, queryMappingConfiguration, operations, delegate); - this.rowMapperFactory = new DefaultRowMapperFactory(getMappingContext(), getConverter(), getQueryMappingConfiguration(), getCallbacks(), getPublisher()); + this.rowMapperFactory = new DefaultRowMapperFactory(getMappingContext(), getConverter(), + getQueryMappingConfiguration(), getCallbacks(), getPublisher()); } @Override @@ -121,7 +121,8 @@ abstract class JdbcQueryLookupStrategy extends RelationalQueryLookupStrategy { JdbcQueryMethod queryMethod = getJdbcQueryMethod(method, repositoryMetadata, projectionFactory, namedQueries); - return new PartTreeJdbcQuery(getMappingContext(), queryMethod, getDialect(), getConverter(), getOperations(), rowMapperFactory); + return new PartTreeJdbcQuery(getMappingContext(), queryMethod, getDialect(), getConverter(), getOperations(), + rowMapperFactory); } } @@ -140,10 +141,10 @@ abstract class JdbcQueryLookupStrategy extends RelationalQueryLookupStrategy { RelationalMappingContext context, JdbcConverter converter, Dialect dialect, QueryMappingConfiguration queryMappingConfiguration, NamedParameterJdbcOperations operations, @Nullable BeanFactory beanfactory, ValueExpressionDelegate delegate) { - super(publisher, callbacks, context, converter, dialect, queryMappingConfiguration, operations, - delegate); + super(publisher, callbacks, context, converter, dialect, queryMappingConfiguration, operations, delegate); - this.rowMapperFactory = new BeanFactoryAwareRowMapperFactory(context, converter, queryMappingConfiguration, callbacks, publisher, beanfactory); + this.rowMapperFactory = new BeanFactoryAwareRowMapperFactory(context, converter, queryMappingConfiguration, + callbacks, publisher, beanfactory); } @Override @@ -192,11 +193,10 @@ abstract class JdbcQueryLookupStrategy extends RelationalQueryLookupStrategy { CreateIfNotFoundQueryLookupStrategy(ApplicationEventPublisher publisher, @Nullable EntityCallbacks callbacks, RelationalMappingContext context, JdbcConverter converter, Dialect dialect, QueryMappingConfiguration queryMappingConfiguration, NamedParameterJdbcOperations operations, - CreateQueryLookupStrategy createStrategy, - DeclaredQueryLookupStrategy lookupStrategy, ValueExpressionDelegate delegate) { + CreateQueryLookupStrategy createStrategy, DeclaredQueryLookupStrategy lookupStrategy, + ValueExpressionDelegate delegate) { - super(publisher, callbacks, context, converter, dialect, queryMappingConfiguration, operations, - delegate); + super(publisher, callbacks, context, converter, dialect, queryMappingConfiguration, operations, delegate); Assert.notNull(createStrategy, "CreateQueryLookupStrategy must not be null"); Assert.notNull(lookupStrategy, "DeclaredQueryLookupStrategy must not be null"); @@ -264,9 +264,9 @@ abstract class JdbcQueryLookupStrategy extends RelationalQueryLookupStrategy { return switch (keyToUse) { case CREATE -> createQueryLookupStrategy; case USE_DECLARED_QUERY -> declaredQueryLookupStrategy; - case CREATE_IF_NOT_FOUND -> new CreateIfNotFoundQueryLookupStrategy( - publisher, callbacks, context, converter, dialect, queryMappingConfiguration, operations, - createQueryLookupStrategy, declaredQueryLookupStrategy, delegate); + case CREATE_IF_NOT_FOUND -> + new CreateIfNotFoundQueryLookupStrategy(publisher, callbacks, context, converter, dialect, + queryMappingConfiguration, operations, createQueryLookupStrategy, declaredQueryLookupStrategy, delegate); }; } @@ -278,15 +278,15 @@ abstract class JdbcQueryLookupStrategy extends RelationalQueryLookupStrategy { return operations; } - QueryMappingConfiguration getQueryMappingConfiguration() { - return queryMappingConfiguration; - } + QueryMappingConfiguration getQueryMappingConfiguration() { + return queryMappingConfiguration; + } - EntityCallbacks getCallbacks() { - return callbacks; - } + EntityCallbacks getCallbacks() { + return callbacks; + } - ApplicationEventPublisher getPublisher() { - return publisher; - } + ApplicationEventPublisher getPublisher() { + return publisher; + } }