Polishing.

Original pull request #1209
See #1110
This commit is contained in:
Jens Schauder
2023-03-23 11:51:58 +01:00
parent d893259d4e
commit e78f7df53d
11 changed files with 40 additions and 56 deletions

View File

@@ -35,13 +35,8 @@ import org.springframework.jdbc.core.namedparam.AbstractSqlParameterSource;
*/
class SqlIdentifierParameterSource extends AbstractSqlParameterSource {
private final Set<SqlIdentifier> identifiers;
private final Map<String, Object> namesToValues;
SqlIdentifierParameterSource() {
this.identifiers = new HashSet<>();
this.namesToValues = new HashMap<>();
}
private final Set<SqlIdentifier> identifiers = new HashSet<>();
private final Map<String, Object> namesToValues = new HashMap<>();
@Override
public boolean hasValue(String paramName) {

View File

@@ -30,7 +30,6 @@ import org.springframework.data.relational.core.dialect.Dialect;
import org.springframework.data.relational.core.mapping.RelationalMappingContext;
import org.springframework.data.relational.core.mapping.RelationalPersistentEntity;
import org.springframework.data.relational.core.mapping.RelationalPersistentProperty;
import org.springframework.data.relational.core.sql.IdentifierProcessing;
import org.springframework.data.relational.core.sql.SqlIdentifier;
import org.springframework.jdbc.support.JdbcUtils;
import org.springframework.lang.Nullable;
@@ -49,11 +48,17 @@ public class SqlParametersFactory {
private final RelationalMappingContext context;
private final JdbcConverter converter;
@Deprecated
/**
* @deprecated use {@link SqlParametersFactory(RelationalMappingContext, JdbcConverter)} instead.
*/
@Deprecated(since = "3.1", forRemoval = true)
public SqlParametersFactory(RelationalMappingContext context, JdbcConverter converter, Dialect dialect) {
this(context, converter);
}
/**
* @since 3.1
*/
public SqlParametersFactory(RelationalMappingContext context, JdbcConverter converter) {
this.context = context;
this.converter = converter;

View File

@@ -87,7 +87,6 @@ public class MyBatisDataAccessStrategy implements DataAccessStrategy {
JdbcConverter converter, NamedParameterJdbcOperations operations, SqlSession sqlSession,
NamespaceStrategy namespaceStrategy, Dialect dialect) {
SqlGeneratorSource sqlGeneratorSource = new SqlGeneratorSource(context, converter, dialect);
SqlParametersFactory sqlParametersFactory = new SqlParametersFactory(context, converter);
InsertStrategyFactory insertStrategyFactory = new InsertStrategyFactory(operations,
@@ -126,15 +125,17 @@ public class MyBatisDataAccessStrategy implements DataAccessStrategy {
* to create such a {@link DataAccessStrategy}.
*
* @param sqlSession Must be non {@literal null}.
*
* @deprecated because identifierProcessing now will not be considered in the process of applying it to {@link SqlIdentifier},
* use {@link MyBatisDataAccessStrategy(SqlSession)} constructor instead
* @deprecated because identifierProcessing now will not be considered in the process of applying it to
* {@link SqlIdentifier}, use {@link MyBatisDataAccessStrategy(SqlSession)} constructor instead
*/
@Deprecated
@Deprecated(since = "3.1", forRemoval = true)
public MyBatisDataAccessStrategy(SqlSession sqlSession, IdentifierProcessing identifierProcessing) {
this(sqlSession);
}
/**
* @since 3.1
*/
public MyBatisDataAccessStrategy(SqlSession sqlSession) {
this.sqlSession = sqlSession;
}