Skip to content

Commit 794a6dc

Browse files
authored
Merge branch 'main' into main
Signed-off-by: Artemiy Degtyarev <[email protected]>
2 parents 676ffc1 + f2541b3 commit 794a6dc

File tree

111 files changed

+822
-337
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+822
-337
lines changed

README.adoc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,17 @@ Here is a quick teaser of an application using Spring Data JDBC Repositories in
3030

3131
[source,java]
3232
----
33+
@Table
34+
public class Person {
35+
36+
@Id
37+
private Long id;
38+
private String firstname;
39+
private String lastname;
40+
41+
// getters and setters
42+
}
43+
3344
interface PersonRepository extends CrudRepository<Person, Long> {
3445
3546
@Query("SELECT * FROM person WHERE lastname = :lastname")

pom.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,22 @@
3535
<h2.version>2.4.240</h2.version>
3636
<hikari.version>5.1.0</hikari.version>
3737
<hsqldb.version>2.7.3</hsqldb.version>
38-
<mariadb-java-client.version>3.5.5</mariadb-java-client.version>
39-
<mssql.version>13.2.0.jre11</mssql.version>
40-
<mysql-connector-java.version>9.4.0</mysql-connector-java.version>
38+
<mariadb-java-client.version>3.5.6</mariadb-java-client.version>
39+
<mssql.version>13.2.1.jre11</mssql.version>
40+
<mysql-connector-java.version>9.5.0</mysql-connector-java.version>
4141
<postgresql.version>42.7.8</postgresql.version>
42-
<oracle.version>23.9.0.25.07</oracle.version>
42+
<oracle.version>23.26.0.0.0</oracle.version>
4343

4444
<!-- R2DBC driver dependencies-->
45-
<r2dbc-postgresql.version>1.0.7.RELEASE</r2dbc-postgresql.version>
46-
<r2dbc-h2.version>1.0.0.RELEASE</r2dbc-h2.version>
45+
<r2dbc-postgresql.version>1.1.1.RELEASE</r2dbc-postgresql.version>
46+
<r2dbc-h2.version>1.1.0.RELEASE</r2dbc-h2.version>
4747
<r2dbc-mariadb.version>1.3.0</r2dbc-mariadb.version>
4848
<r2dbc-mssql.version>1.0.3.RELEASE</r2dbc-mssql.version>
4949
<r2dbc-mysql.version>1.4.1</r2dbc-mysql.version>
5050
<oracle-r2dbc.version>1.3.0</oracle-r2dbc.version>
5151

5252
<!-- test dependencies -->
53-
<archunit.version>1.3.0</archunit.version>
53+
<archunit.version>1.4.1</archunit.version>
5454

5555
<mbr.version>0.4.0.BUILD-SNAPSHOT</mbr.version>
5656
</properties>

spring-data-jdbc/pom.xml

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,6 @@
2323
<project.root>${basedir}/..</project.root>
2424
</properties>
2525

26-
<dependencyManagement>
27-
<dependencies>
28-
<dependency>
29-
<groupId>org.testcontainers</groupId>
30-
<artifactId>testcontainers-bom</artifactId>
31-
<version>${testcontainers}</version>
32-
<type>pom</type>
33-
<scope>import</scope>
34-
</dependency>
35-
</dependencies>
36-
</dependencyManagement>
37-
3826
<dependencies>
3927

4028
<dependency>
@@ -205,6 +193,13 @@
205193
</exclusions>
206194
</dependency>
207195

196+
<dependency>
197+
<groupId>org.jmolecules</groupId>
198+
<artifactId>jmolecules-ddd</artifactId>
199+
<version>${jmolecules}</version>
200+
<scope>test</scope>
201+
</dependency>
202+
208203
<dependency>
209204
<groupId>org.jmolecules.integrations</groupId>
210205
<artifactId>jmolecules-spring</artifactId>
@@ -241,9 +236,16 @@
241236

242237
<!-- Testcontainers -->
243238

239+
<dependency>
240+
<groupId>org.apache.commons</groupId>
241+
<artifactId>commons-lang3</artifactId>
242+
<version>3.19.0</version>
243+
<scope>test</scope>
244+
</dependency>
245+
244246
<dependency>
245247
<groupId>org.testcontainers</groupId>
246-
<artifactId>mysql</artifactId>
248+
<artifactId>testcontainers-mysql</artifactId>
247249
<scope>test</scope>
248250
<exclusions>
249251
<exclusion>
@@ -255,31 +257,31 @@
255257

256258
<dependency>
257259
<groupId>org.testcontainers</groupId>
258-
<artifactId>postgresql</artifactId>
260+
<artifactId>testcontainers-postgresql</artifactId>
259261
<scope>test</scope>
260262
</dependency>
261263

262264
<dependency>
263265
<groupId>org.testcontainers</groupId>
264-
<artifactId>mariadb</artifactId>
266+
<artifactId>testcontainers-mariadb</artifactId>
265267
<scope>test</scope>
266268
</dependency>
267269

268270
<dependency>
269271
<groupId>org.testcontainers</groupId>
270-
<artifactId>mssqlserver</artifactId>
272+
<artifactId>testcontainers-mssqlserver</artifactId>
271273
<scope>test</scope>
272274
</dependency>
273275

274276
<dependency>
275277
<groupId>org.testcontainers</groupId>
276-
<artifactId>db2</artifactId>
278+
<artifactId>testcontainers-db2</artifactId>
277279
<scope>test</scope>
278280
</dependency>
279281

280282
<dependency>
281283
<groupId>org.testcontainers</groupId>
282-
<artifactId>oracle-free</artifactId>
284+
<artifactId>testcontainers-oracle-free</artifactId>
283285
<scope>test</scope>
284286
</dependency>
285287

spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/JdbcAggregateOperations.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,11 @@ public interface JdbcAggregateOperations {
230230
* @param pageable the pagination information. Must not be {@code null}.
231231
* @return Guaranteed to be not {@code null}.
232232
* @since 2.0
233+
* @deprecated since 4.0. Use {@link #findAll(Class, Sort)} together with {@link #count(Class)} to construct results
234+
* of type {@link Page}.The API design is conflicts regarding pagination information. Also, pagination is
235+
* primarily a feature of the repository and not the template API.
233236
*/
237+
@Deprecated(since = "4.0", forRemoval = true)
234238
<T> Page<T> findAll(Class<T> domainType, Pageable pageable);
235239

236240
/**
@@ -275,7 +279,11 @@ public interface JdbcAggregateOperations {
275279
* @param pageable can be null.
276280
* @return a {@link Page} of entities matching the given {@link Example}.
277281
* @since 3.0
282+
* @deprecated since 4.0. Use {@link #findAll(Query, Class)} together with {@link #count(Query, Class)} to construct
283+
* results of type {@link Page}. The API design is conflicts regarding pagination information. Also,
284+
* pagination is primarily a feature of the repository and not the template API.
278285
*/
286+
@Deprecated(since = "4.0", forRemoval = true)
279287
<T> Page<T> findAll(Query query, Class<T> domainType, Pageable pageable);
280288

281289
/**

spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/JdbcAggregateTemplate.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import java.util.stream.StreamSupport;
3232

3333
import org.jspecify.annotations.Nullable;
34+
3435
import org.springframework.beans.BeansException;
3536
import org.springframework.context.ApplicationContext;
3637
import org.springframework.context.ApplicationContextAware;
@@ -41,7 +42,6 @@
4142
import org.springframework.data.jdbc.core.convert.DataAccessStrategy;
4243
import org.springframework.data.jdbc.core.convert.EntityRowMapper;
4344
import org.springframework.data.jdbc.core.convert.JdbcConverter;
44-
import org.springframework.data.jdbc.core.convert.QueryMappingConfiguration;
4545
import org.springframework.data.mapping.IdentifierAccessor;
4646
import org.springframework.data.mapping.callback.EntityCallbacks;
4747
import org.springframework.data.relational.core.EntityLifecycleEventDelegate;
@@ -78,6 +78,7 @@
7878
* @author Sergey Korotaev
7979
* @author Mikhail Polivakha
8080
*/
81+
@SuppressWarnings("removal")
8182
public class JdbcAggregateTemplate implements JdbcAggregateOperations, ApplicationContextAware {
8283

8384
private final EntityLifecycleEventDelegate eventDelegate = new EntityLifecycleEventDelegate();
@@ -88,7 +89,6 @@ public class JdbcAggregateTemplate implements JdbcAggregateOperations, Applicati
8889
private final JdbcConverter converter;
8990

9091
private @Nullable EntityCallbacks entityCallbacks;
91-
private QueryMappingConfiguration queryMappingConfiguration = QueryMappingConfiguration.EMPTY;
9292

9393
/**
9494
* Creates a new {@link JdbcAggregateTemplate} given {@link RelationalMappingContext} and {@link DataAccessStrategy}.
@@ -360,6 +360,7 @@ public <T> Stream<T> streamAll(Class<T> domainType, Sort sort) {
360360
}
361361

362362
@Override
363+
@Deprecated(since = "4.0", forRemoval = true)
363364
public <T> Page<T> findAll(Class<T> domainType, Pageable pageable) {
364365

365366
Assert.notNull(domainType, "Domain type must not be null");
@@ -389,6 +390,7 @@ public <T> Stream<T> streamAll(Query query, Class<T> domainType) {
389390
}
390391

391392
@Override
393+
@Deprecated(since = "4.0", forRemoval = true)
392394
public <T> Page<T> findAll(Query query, Class<T> domainType, Pageable pageable) {
393395

394396
Iterable<T> items = triggerAfterConvert(accessStrategy.findAll(query, domainType, pageable));

spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/convert/EntityRowMapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
import java.sql.ResultSet;
1919
import java.sql.SQLException;
2020

21+
import org.springframework.data.core.TypeInformation;
2122
import org.springframework.data.relational.core.mapping.AggregatePath;
2223
import org.springframework.data.relational.core.mapping.RelationalPersistentEntity;
2324
import org.springframework.data.relational.domain.RowDocument;
24-
import org.springframework.data.util.TypeInformation;
2525
import org.springframework.jdbc.core.RowMapper;
2626

2727
/**

spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/convert/JdbcConverter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@
1818
import java.sql.SQLType;
1919

2020
import org.jspecify.annotations.Nullable;
21+
22+
import org.springframework.data.core.TypeInformation;
2123
import org.springframework.data.jdbc.core.mapping.JdbcValue;
2224
import org.springframework.data.relational.core.conversion.RelationalConverter;
2325
import org.springframework.data.relational.core.mapping.RelationalMappingContext;
2426
import org.springframework.data.relational.core.mapping.RelationalPersistentProperty;
2527
import org.springframework.data.relational.domain.RowDocument;
26-
import org.springframework.data.util.TypeInformation;
2728

2829
/**
2930
* A {@link JdbcConverter} is responsible for converting for values to the native relational representation and vice

spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/convert/JdbcCustomConversions.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import org.springframework.data.convert.ConverterBuilder;
3030
import org.springframework.data.convert.CustomConversions;
3131
import org.springframework.data.jdbc.core.mapping.JdbcSimpleTypes;
32+
import org.springframework.data.mapping.model.SimpleTypeHolder;
3233
import org.springframework.data.relational.core.dialect.Dialect;
3334
import org.springframework.lang.Contract;
3435
import org.springframework.util.Assert;
@@ -177,9 +178,8 @@ static JdbcConverterConfigurer from(Dialect dialect) {
177178
converters.addAll(dialect.getConverters());
178179
converters.addAll(JdbcCustomConversions.storeConverters());
179180

180-
StoreConversions storeConversions = StoreConversions.of(JdbcSimpleTypes.HOLDER, converters);
181-
182-
return new JdbcConverterConfigurer(storeConversions);
181+
SimpleTypeHolder simpleTypeHolder = new SimpleTypeHolder(dialect.simpleTypes(), JdbcSimpleTypes.HOLDER);
182+
return new JdbcConverterConfigurer(StoreConversions.of(simpleTypeHolder, converters));
183183
}
184184

185185
/**

spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/convert/MapEntityRowMapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
import java.util.HashMap;
2121
import java.util.Map;
2222

23+
import org.springframework.data.core.TypeInformation;
2324
import org.springframework.data.relational.core.mapping.AggregatePath;
2425
import org.springframework.data.relational.core.sql.SqlIdentifier;
2526
import org.springframework.data.relational.domain.RowDocument;
26-
import org.springframework.data.util.TypeInformation;
2727
import org.springframework.jdbc.core.RowMapper;
2828
import org.springframework.util.Assert;
2929

spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/convert/MappingJdbcConverter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,12 @@
2626
import java.util.function.Function;
2727

2828
import org.jspecify.annotations.Nullable;
29+
2930
import org.springframework.context.ApplicationContextAware;
3031
import org.springframework.core.convert.converter.Converter;
3132
import org.springframework.dao.DataAccessException;
3233
import org.springframework.data.convert.CustomConversions;
34+
import org.springframework.data.core.TypeInformation;
3335
import org.springframework.data.jdbc.core.mapping.AggregateReference;
3436
import org.springframework.data.jdbc.core.mapping.JdbcValue;
3537
import org.springframework.data.jdbc.support.JdbcUtil;
@@ -45,7 +47,6 @@
4547
import org.springframework.data.relational.core.mapping.RelationalPersistentEntity;
4648
import org.springframework.data.relational.core.mapping.RelationalPersistentProperty;
4749
import org.springframework.data.relational.domain.RowDocument;
48-
import org.springframework.data.util.TypeInformation;
4950
import org.springframework.jdbc.UncategorizedSQLException;
5051
import org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator;
5152
import org.springframework.jdbc.support.SQLExceptionSubclassTranslator;

0 commit comments

Comments
 (0)