Skip to content

Commit 470f922

Browse files
committed
update version to released
1 parent 2d21c0e commit 470f922

16 files changed

+798
-39
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
<parent>
1616
<groupId>org.springframework.data.build</groupId>
1717
<artifactId>spring-data-parent</artifactId>
18-
<version>3.5.0-RC1</version>
18+
<version>3.5.1</version>
1919
</parent>
2020

2121
<properties>
2222
<dist.id>spring-data-jdbc</dist.id>
23-
<springdata.commons>3.5.0-RC1</springdata.commons>
23+
<springdata.commons>3.5.1</springdata.commons>
2424
<liquibase.version>4.21.1</liquibase.version>
2525
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
2626

spring-data-jdbc/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
<dependency>
4646
<groupId>org.springframework.data</groupId>
4747
<artifactId>spring-data-jdbc</artifactId>
48-
<version>3.5.0-RC1</version>
48+
<version>${springdata.commons}</version>
4949
</dependency>
5050

5151
<dependency>

spring-data-jdbc/src/test/java/org/springframework/data/jdbc/DependencyTests.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package org.springframework.data.jdbc;
1717

1818
import org.assertj.core.api.SoftAssertions;
19+
import org.junit.jupiter.api.Disabled;
1920
import org.junit.jupiter.api.Test;
2021
import org.springframework.data.auditing.config.AuditingHandlerBeanDefinitionParser;
2122

@@ -34,6 +35,7 @@
3435
*
3536
* @author Jens Schauder
3637
*/
38+
@Disabled("Disabled because of JdbcArrayColumns and Dialect cycle to be resolved in 4.0")
3739
public class DependencyTests {
3840

3941
@Test

spring-data-jdbc/src/test/java/org/springframework/data/jdbc/core/AbstractJdbcAggregateTemplateIntegrationTests.java

Lines changed: 80 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@
2929
import java.util.stream.IntStream;
3030
import java.util.stream.Stream;
3131

32+
import org.junit.jupiter.api.Disabled;
3233
import org.junit.jupiter.api.Test;
3334
import org.springframework.beans.factory.annotation.Autowired;
34-
import org.springframework.context.ApplicationEventPublisher;
35+
import org.springframework.context.ApplicationContext;
3536
import org.springframework.context.annotation.Bean;
3637
import org.springframework.context.annotation.Configuration;
3738
import org.springframework.context.annotation.Import;
@@ -60,6 +61,7 @@
6061
import org.springframework.data.relational.core.mapping.MappedCollection;
6162
import org.springframework.data.relational.core.mapping.RelationalMappingContext;
6263
import org.springframework.data.relational.core.mapping.Table;
64+
import org.springframework.data.relational.core.mapping.event.BeforeConvertCallback;
6365
import org.springframework.data.relational.core.query.Criteria;
6466
import org.springframework.data.relational.core.query.CriteriaDefinition;
6567
import org.springframework.data.relational.core.query.Query;
@@ -236,7 +238,25 @@ void findAllByQuery() {
236238
Query query = Query.query(criteria);
237239
Iterable<SimpleListParent> reloadedById = template.findAll(query, SimpleListParent.class);
238240

239-
assertThat(reloadedById).extracting(e -> e.id, e -> e.content.size()).containsExactly(tuple(two.id, 2));
241+
assertThat(reloadedById) //
242+
.extracting(e -> e.id, e-> e.name, e -> e.content.size()) //
243+
.containsExactly(tuple(two.id, two.name, 2));
244+
}
245+
246+
@Test // GH-1803
247+
void findAllByQueryWithColumns() {
248+
249+
template.save(SimpleListParent.of("one", "one_1"));
250+
SimpleListParent two = template.save(SimpleListParent.of("two", "two_1", "two_2"));
251+
template.save(SimpleListParent.of("three", "three_1", "three_2", "three_3"));
252+
253+
CriteriaDefinition criteria = CriteriaDefinition.from(Criteria.where("id").is(two.id));
254+
Query query = Query.query(criteria).columns("id");
255+
Iterable<SimpleListParent> reloadedById = template.findAll(query, SimpleListParent.class);
256+
257+
assertThat(reloadedById) //
258+
.extracting(e -> e.id, e-> e.name, e -> e.content.size()) //
259+
.containsExactly(tuple(two.id, null, 2));
240260
}
241261

242262
@Test // GH-1601
@@ -1373,6 +1393,22 @@ void mapWithEnumKey() {
13731393
assertThat(enumMapOwners).containsExactly(enumMapOwner);
13741394
}
13751395

1396+
@Test // GH-2064
1397+
void saveAllBeforeConvertCallback() {
1398+
1399+
BeforeConvertCallbackForSaveBatch first = new BeforeConvertCallbackForSaveBatch("first");
1400+
BeforeConvertCallbackForSaveBatch second = new BeforeConvertCallbackForSaveBatch("second");
1401+
BeforeConvertCallbackForSaveBatch third = new BeforeConvertCallbackForSaveBatch("third");
1402+
1403+
template.saveAll(List.of(first, second, third));
1404+
1405+
List<BeforeConvertCallbackForSaveBatch> allEntriesInTable = template
1406+
.findAll(BeforeConvertCallbackForSaveBatch.class);
1407+
1408+
assertThat(allEntriesInTable).hasSize(3).extracting(BeforeConvertCallbackForSaveBatch::getName)
1409+
.containsExactlyInAnyOrder("first", "second", "third");
1410+
}
1411+
13761412
@Test // GH-1684
13771413
void oneToOneWithIdenticalIdColumnName() {
13781414

@@ -2184,6 +2220,31 @@ public Short getVersion() {
21842220
}
21852221
}
21862222

2223+
@Table("BEFORE_CONVERT_CALLBACK_FOR_SAVE_BATCH")
2224+
static class BeforeConvertCallbackForSaveBatch {
2225+
2226+
@Id
2227+
private String id;
2228+
2229+
private String name;
2230+
2231+
public BeforeConvertCallbackForSaveBatch(String name) {
2232+
this.name = name;
2233+
}
2234+
2235+
public String getId() {
2236+
return id;
2237+
}
2238+
2239+
public void setId(String id) {
2240+
this.id = id;
2241+
}
2242+
2243+
public String getName() {
2244+
return name;
2245+
}
2246+
}
2247+
21872248
@Table("VERSIONED_AGGREGATE")
21882249
static class AggregateWithPrimitiveShortVersion extends VersionedAggregate {
21892250

@@ -2214,12 +2275,14 @@ static class WithIdOnly {
22142275

22152276
@Table
22162277
static class WithInsertOnly {
2278+
22172279
@Id Long id;
22182280
@InsertOnlyProperty String insertOnly;
22192281
}
22202282

22212283
@Table
22222284
static class MultipleCollections {
2285+
22232286
@Id Long id;
22242287
String name;
22252288
List<ListElement> listElements = new ArrayList<>();
@@ -2271,9 +2334,17 @@ TestClass testClass() {
22712334
}
22722335

22732336
@Bean
2274-
JdbcAggregateOperations operations(ApplicationEventPublisher publisher, RelationalMappingContext context,
2337+
BeforeConvertCallback<BeforeConvertCallbackForSaveBatch> callback() {
2338+
return aggregate -> {
2339+
aggregate.setId(UUID.randomUUID().toString());
2340+
return aggregate;
2341+
};
2342+
}
2343+
2344+
@Bean
2345+
JdbcAggregateOperations operations(ApplicationContext applicationContext, RelationalMappingContext context,
22752346
DataAccessStrategy dataAccessStrategy, JdbcConverter converter) {
2276-
return new JdbcAggregateTemplate(publisher, context, converter, dataAccessStrategy);
2347+
return new JdbcAggregateTemplate(applicationContext, context, converter, dataAccessStrategy);
22772348
}
22782349
}
22792350

@@ -2285,5 +2356,10 @@ static class JdbcAggregateTemplateIntegrationTests extends AbstractJdbcAggregate
22852356
static class JdbcAggregateTemplateSingleQueryLoadingIntegrationTests
22862357
extends AbstractJdbcAggregateTemplateIntegrationTests {
22872358

2359+
@Disabled
2360+
@Override
2361+
void findAllByQueryWithColumns() {
2362+
super.findAllByQueryWithColumns();
2363+
}
22882364
}
22892365
}

0 commit comments

Comments
 (0)