Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>org.springframework.data</groupId>
<artifactId>spring-data-relational-parent</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0-remove-deprecation-SNAPSHOT</version>
<packaging>pom</packaging>

<name>Spring Data Relational Parent</name>
Expand Down
2 changes: 1 addition & 1 deletion spring-data-jdbc-distribution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-relational-parent</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0-remove-deprecation-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
4 changes: 2 additions & 2 deletions spring-data-jdbc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion>

<artifactId>spring-data-jdbc</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0-remove-deprecation-SNAPSHOT</version>

<name>Spring Data JDBC</name>
<description>Spring Data module for JDBC repositories.</description>
Expand All @@ -15,7 +15,7 @@
<parent>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-relational-parent</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0-remove-deprecation-SNAPSHOT</version>
</parent>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,6 @@ public SQLType getTargetSqlType(RelationalPersistentProperty property) {
return JdbcUtil.targetSqlTypeFor(getColumnType(property));
}

@Override
@Deprecated
public int getSqlType(RelationalPersistentProperty property) {
return JdbcUtil.sqlTypeFor(getColumnType(property));
}

@Override
public Class<?> getColumnType(RelationalPersistentProperty property) {
return doGetColumnType(property);
Expand Down Expand Up @@ -261,12 +255,6 @@ private boolean canWriteAsJdbcValue(@Nullable Object value) {
return customWriteTarget.isPresent() && customWriteTarget.get().isAssignableFrom(JdbcValue.class);
}

@Override
@Deprecated
public JdbcValue writeJdbcValue(@Nullable Object value, Class<?> columnType, int sqlType) {
return writeJdbcValue(value, columnType, JdbcUtil.jdbcTypeFor(sqlType));
}

/*
* (non-Javadoc)
* @see org.springframework.data.jdbc.core.convert.JdbcConverter#writeValue(java.lang.Object, java.lang.Class, int)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,6 @@ public CascadingDataAccessStrategy(List<DataAccessStrategy> strategies) {
this.strategies = new ArrayList<>(strategies);
}

@Override
public <T> Object insert(T instance, Class<T> domainType, Identifier identifier) {
return collect(das -> das.insert(instance, domainType, identifier));
}

@Override
public <T> Object insert(T instance, Class<T> domainType, Identifier identifier, IdValueSource idValueSource) {
return collect(das -> das.insert(instance, domainType, identifier, idValueSource));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,6 @@
*/
public interface DataAccessStrategy extends RelationResolver {

/**
* Inserts the data of a single entity. Referenced entities don't get handled.
*
* @param <T> the type of the instance.
* @param instance the instance to be stored. Must not be {@code null}.
* @param domainType the type of the instance. Must not be {@code null}.
* @param identifier information about data that needs to be considered for the insert but which is not part of the
* entity. Namely, references back to a parent entity and key/index columns for entities that are stored in a
* {@link Map} or {@link List}.
* @return the id generated by the database if any.
* @since 1.1
* @deprecated since 2.4, use {@link #insert(Object, Class, Identifier, IdValueSource)}. This will no longer insert as
* expected when the id property of the instance is pre-populated.
*/
@Nullable
@Deprecated
<T> Object insert(T instance, Class<T> domainType, Identifier identifier);

/**
* Inserts the data of a single entity. Referenced entities don't get handled.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,6 @@ public DefaultDataAccessStrategy(SqlGeneratorSource sqlGeneratorSource, Relation
this.insertStrategyFactory = insertStrategyFactory;
}

@Override
public <T> Object insert(T instance, Class<T> domainType, Identifier identifier) {

RelationalPersistentEntity<?> persistentEntity = context.getRequiredPersistentEntity(domainType);
return insert(instance, domainType, identifier, IdValueSource.forInstance(instance, persistentEntity));
}

@Override
public <T> Object insert(T instance, Class<T> domainType, Identifier identifier, IdValueSource idValueSource) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@ public class DelegatingDataAccessStrategy implements DataAccessStrategy {

private DataAccessStrategy delegate;

@Override
public <T> Object insert(T instance, Class<T> domainType, Identifier identifier) {
return delegate.insert(instance, domainType, identifier);
}

@Override
public <T> Object insert(T instance, Class<T> domainType, Identifier identifier, IdValueSource idValueSource) {
return delegate.insert(instance, domainType, identifier, idValueSource);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* Copyright 2019-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -35,17 +35,6 @@
*/
public interface JdbcConverter extends RelationalConverter {

/**
* Convert a property value into a {@link JdbcValue} that contains the converted value and information how to bind it
* to JDBC parameters.
*
* @param value a value as it is used in the object model. May be {@code null}.
* @param type {@literal Class} into which the value is to be converted. Must not be {@code null}.
* @param sqlType the type constant from {@link java.sql.Types} to be used if non is specified by a converter.
* @return The converted value wrapped in a {@link JdbcValue}. Guaranteed to be not {@literal null}.
*/
JdbcValue writeJdbcValue(@Nullable Object value, Class<?> type, int sqlType);

/**
* Convert a property value into a {@link JdbcValue} that contains the converted value and information how to bind it
* to JDBC parameters.
Expand Down Expand Up @@ -99,8 +88,4 @@ public interface JdbcConverter extends RelationalConverter {
* @since 2.0
*/
SQLType getTargetSqlType(RelationalPersistentProperty property);

@Deprecated
int getSqlType(RelationalPersistentProperty property);

}
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,10 @@
* Extension to {@link BasicRelationalPersistentProperty}.
*
* @author Mark Paluch
* @author Jens Schauder
*/
public class BasicJdbcPersistentProperty extends BasicRelationalPersistentProperty {

/**
* Creates a new {@link BasicJdbcPersistentProperty}.
*
* @param property must not be {@literal null}.
* @param owner must not be {@literal null}.
* @param simpleTypeHolder must not be {@literal null}.
* @param context must not be {@literal null}
* @deprecated since 2.0, use
* {@link #BasicJdbcPersistentProperty(Property, PersistentEntity, SimpleTypeHolder, NamingStrategy)}.
*/
@Deprecated
public BasicJdbcPersistentProperty(Property property, PersistentEntity<?, RelationalPersistentProperty> owner,
SimpleTypeHolder simpleTypeHolder, RelationalMappingContext context) {
super(property, owner, simpleTypeHolder, context);
}

/**
* Creates a new {@link BasicJdbcPersistentProperty}.
*
Expand All @@ -64,9 +49,4 @@ public BasicJdbcPersistentProperty(Property property, PersistentEntity<?, Relati
public boolean isAssociation() {
return super.isAssociation() || AggregateReference.class.isAssignableFrom(getRawType());
}

@Override
public boolean isReference() {
return isAssociation();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,6 @@ public void setNamespaceStrategy(NamespaceStrategy namespaceStrategy) {
this.namespaceStrategy = namespaceStrategy;
}

@Override
public <T> Object insert(T instance, Class<T> domainType, Identifier identifier) {

MyBatisContext myBatisContext = new MyBatisContext(identifier, instance, domainType);
sqlSession().insert(namespace(domainType) + ".insert", myBatisContext);

return myBatisContext.getId();
}

@Override
public <T> Object insert(T instance, Class<T> domainType, Identifier identifier, IdValueSource idValueSource) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.springframework.data.jdbc.core.mapping.JdbcMappingContext;
import org.springframework.data.jdbc.mybatis.MyBatisDataAccessStrategy;
import org.springframework.data.relational.core.dialect.Dialect;
import org.springframework.data.relational.core.mapping.RelationalMappingContext;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,27 +87,6 @@ private JdbcUtil() {
throw new UnsupportedOperationException("This is a utility class and cannot be instantiated");
}

/**
* Returns the {@link Types} value suitable for passing a value of the provided type to a
* {@link java.sql.PreparedStatement}.
*
* @param type The type of value to be bound to a {@link java.sql.PreparedStatement}.
* @return One of the values defined in {@link Types} or {@link JdbcUtils#TYPE_UNKNOWN}.
* @deprecated use {@link #targetSqlTypeFor(Class)} instead.
*/
@Deprecated
public static int sqlTypeFor(Class<?> type) {

Assert.notNull(type, "Type must not be null");

return sqlTypeMappings.keySet().stream() //
.filter(k -> k.isAssignableFrom(type)) //
.findFirst() //
.map(sqlTypeMappings::get) //
.map(SQLType::getVendorTypeNumber)
.orElse(JdbcUtils.TYPE_UNKNOWN);
}

/**
* Returns the {@link SQLType} value suitable for passing a value of the provided type to JDBC driver.
*
Expand All @@ -124,49 +103,4 @@ public static SQLType targetSqlTypeFor(Class<?> type) {
.map(sqlTypeMappings::get) //
.orElse(JdbcUtil.TYPE_UNKNOWN);
}

/**
* Converts a {@link JDBCType} to an {@code int} value as defined in {@link Types}.
*
* @param jdbcType value to be converted. May be {@literal null}.
* @return One of the values defined in {@link Types} or {@link JdbcUtils#TYPE_UNKNOWN}.
* @deprecated there is no replacement.
*/
@Deprecated
public static int sqlTypeFor(@Nullable SQLType jdbcType) {
return jdbcType == null ? JdbcUtils.TYPE_UNKNOWN : jdbcType.getVendorTypeNumber();
}

/**
* Converts a value defined in {@link Types} into a {@link JDBCType} instance or {@literal null} if the value is
* {@link JdbcUtils#TYPE_UNKNOWN}
*
* @param sqlType One of the values defined in {@link Types} or {@link JdbcUtils#TYPE_UNKNOWN}.
* @return a matching {@link JDBCType} instance or {@literal null}.
* @deprecated This is now a noop
*/
@Nullable
@Deprecated
public static SQLType jdbcTypeFor(int sqlType) {

if (sqlType == JdbcUtils.TYPE_UNKNOWN) {
return null;
}

return JDBCType.valueOf(sqlType);
}

/**
* Returns the {@link JDBCType} suitable for passing a value of the provided type to a
* {@link java.sql.PreparedStatement}.
*
* @param type The type of value to be bound to a {@link java.sql.PreparedStatement}.
* @return a matching {@link JDBCType} instance or {@literal null}.
* @deprecated Use {@link #targetSqlTypeFor(Class)} instead.
*/
@Deprecated
public static SQLType jdbcTypeFor(Class<?> type) {

return targetSqlTypeFor(type);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,6 @@ public void getSchema() {
assertThat(target.getSchema()).isEqualTo("");
}

@Test // DATAJDBC-184
public void getQualifiedTableName() {

assertThat(target.getQualifiedTableName(persistentEntity.getType())).isEqualTo("dummy_entity");
}

@Data
private static class DummyEntity {

Expand Down
4 changes: 2 additions & 2 deletions spring-data-r2dbc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion>

<artifactId>spring-data-r2dbc</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0-remove-deprecation-SNAPSHOT</version>

<name>Spring Data R2DBC</name>
<description>Spring Data module for R2DBC</description>
Expand All @@ -15,7 +15,7 @@
<parent>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-relational-parent</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0-remove-deprecation-SNAPSHOT</version>
</parent>

<properties>
Expand Down
4 changes: 2 additions & 2 deletions spring-data-relational/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
<modelVersion>4.0.0</modelVersion>

<artifactId>spring-data-relational</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0-remove-deprecation-SNAPSHOT</version>

<name>Spring Data Relational</name>
<description>Spring Data Relational support</description>

<parent>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-relational-parent</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0-remove-deprecation-SNAPSHOT</version>
</parent>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
*
* @author Mark Paluch
* @author Mikhail Polivakha
* @author Jens Schauder
* @since 1.1
*/
public class RenderContextFactory {
Expand Down Expand Up @@ -106,11 +107,6 @@ public IdentifierProcessing getIdentifierProcessing() {
return renderingDialect.getIdentifierProcessing();
}

@Override
public SelectRenderContext getSelect() {
return getSelectRenderContext();
}

@Override
public SelectRenderContext getSelectRenderContext() {
return selectRenderContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,6 @@ public boolean isEntity() {
return super.isEntity() && !isAssociation();
}

@Override
public boolean isReference() {
return false;
}

@Override
public SqlIdentifier getColumnName() {
return columnName.get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* A {@link NamingStrategy} to cache the results of the target one.
*
* @author Oliver Drotbohm
* @author Jens Schauder
* @since 1.1
*/
class CachingNamingStrategy implements NamingStrategy {
Expand Down Expand Up @@ -57,12 +58,6 @@ public String getKeyColumn(RelationalPersistentProperty property) {
return keyColumns.computeIfAbsent(property, delegate::getKeyColumn);
}

@Override
@Deprecated
public String getQualifiedTableName(Class<?> type) {
return qualifiedTableNames.computeIfAbsent(type, delegate::getQualifiedTableName);
}

@Override
public String getTableName(Class<?> type) {
return tableNames.computeIfAbsent(type, delegate::getTableName);
Expand Down
Loading