Skip to content

DATAJDBC-629 - Implements CrudRepository.deleteAllById. #252

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
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
4 changes: 2 additions & 2 deletions 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>2.2.0-SNAPSHOT</version>
<version>2.2.0-DATAJDBC-629-SNAPSHOT</version>
<packaging>pom</packaging>

<name>Spring Data Relational Parent</name>
Expand All @@ -20,7 +20,7 @@

<properties>
<dist.id>spring-data-jdbc</dist.id>
<springdata.commons>2.5.0-SNAPSHOT</springdata.commons>
<springdata.commons>2.4.0-DATACMNS-800-SNAPSHOT</springdata.commons>
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>

<degraph-check.version>0.1.4</degraph-check.version>
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>2.2.0-SNAPSHOT</version>
<version>2.2.0-DATAJDBC-629-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>2.2.0-SNAPSHOT</version>
<version>2.2.0-DATAJDBC-629-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>2.2.0-SNAPSHOT</version>
<version>2.2.0-DATAJDBC-629-SNAPSHOT</version>
</parent>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ public void deleteAll() {
entityOperations.deleteAll(entity.getType());
}

@Override
public void deleteAllById(Iterable<? extends ID> ids) {
ids.forEach(it -> entityOperations.deleteById(it, entity.getType()));
}

/*
* (non-Javadoc)
* @see org.springframework.data.repository.PagingAndSortingRepository#findAll(org.springframework.data.domain.Sort sort)
Expand All @@ -172,4 +177,5 @@ public Iterable<T> findAll(Sort sort) {
public Page<T> findAll(Pageable pageable) {
return entityOperations.findAll(entity.getType(), pageable);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,20 @@ public void deleteByList() {
.containsExactlyInAnyOrder(two.getIdProp());
}

@Test // DATAJDBC-629
public void deleteByIdList() {

DummyEntity one = repository.save(createDummyEntity());
DummyEntity two = repository.save(createDummyEntity());
DummyEntity three = repository.save(createDummyEntity());

repository.deleteAllById(asList(one.idProp, three.idProp));

assertThat(repository.findAll()) //
.extracting(DummyEntity::getIdProp) //
.containsExactlyInAnyOrder(two.getIdProp());
}

@Test // DATAJDBC-97
public void deleteAll() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,5 +228,10 @@ public void deleteAll(Iterable<? extends T> iterable) {
public void deleteAll() {

}

@Override
public void deleteAllById(Iterable<? extends ID> ids) {

}
}
}
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>2.2.0-SNAPSHOT</version>
<version>2.2.0-DATAJDBC-629-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>2.2.0-SNAPSHOT</version>
<version>2.2.0-DATAJDBC-629-SNAPSHOT</version>
</parent>

<properties>
Expand Down