|
| 1 | +package com.navercorp.spring.data.jdbc.plus.repository.config; |
| 2 | + |
| 3 | +import org.jspecify.annotations.Nullable; |
| 4 | +import org.springframework.data.jdbc.core.convert.DataAccessStrategy; |
| 5 | +import org.springframework.data.jdbc.core.convert.JdbcConverter; |
| 6 | +import org.springframework.data.jdbc.core.convert.QueryMappingConfiguration; |
| 7 | +import org.springframework.data.jdbc.core.dialect.JdbcDialect; |
| 8 | +import org.springframework.data.jdbc.core.mapping.JdbcMappingContext; |
| 9 | +import org.springframework.data.jdbc.repository.config.JdbcConfiguration; |
| 10 | +import org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations; |
| 11 | + |
| 12 | +import com.navercorp.spring.data.jdbc.plus.support.convert.JdbcPlusDataAccessStrategy; |
| 13 | +import com.navercorp.spring.data.jdbc.plus.support.convert.JdbcPlusDataAccessStrategyFactory; |
| 14 | + |
| 15 | +/** |
| 16 | + * Utility class to providing factory methods for JDBC Plus infrastructure components. |
| 17 | + * <p> |
| 18 | + * Mainly for use within the framework or for configuration arrangements that require customization of configuration. |
| 19 | + * {@link org.springframework.data.jdbc.repository.config.JdbcConfiguration} |
| 20 | + * |
| 21 | + * @since 4.0 |
| 22 | + */ |
| 23 | +public class JdbcPlusConfiguration { |
| 24 | + private JdbcPlusConfiguration() {} |
| 25 | + |
| 26 | + public static DataAccessStrategy createDataAccessStrategy( |
| 27 | + NamedParameterJdbcOperations operations, |
| 28 | + JdbcConverter jdbcConverter, |
| 29 | + @Nullable QueryMappingConfiguration mappingConfiguration, |
| 30 | + JdbcDialect dialect |
| 31 | + ) { |
| 32 | + DataAccessStrategy delegate = |
| 33 | + JdbcConfiguration.createDataAccessStrategy(operations, jdbcConverter, mappingConfiguration, dialect); |
| 34 | + |
| 35 | + return new JdbcPlusDataAccessStrategyFactory( |
| 36 | + delegate, |
| 37 | + jdbcConverter, |
| 38 | + operations, |
| 39 | + dialect |
| 40 | + ).create(); |
| 41 | + } |
| 42 | +} |
0 commit comments