Skip to content

SimpleCassandraRepository.deleteAllById removing only first element #1298

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
Veermove opened this issue Aug 22, 2022 · 2 comments
Closed

SimpleCassandraRepository.deleteAllById removing only first element #1298

Veermove opened this issue Aug 22, 2022 · 2 comments
Assignees
Labels
type: bug A general bug

Comments

@Veermove
Copy link

Hi, recently i found, what i believe to be a bug. While using ReactiveCassandraRepository i found that while using a composite key, the method deleteAllById deleted only the first element from provided Iterable. The setup looked like this:

interface ReactiveCassandraRepository<Center, CenterKey>
@Table("center")
class Center {
    @PrimaryKeyColumn(type = PrimaryKeyType.CLUSTERED, ordinal = 0)
    private String id;
    @PrimaryKeyColumn(type = PrimaryKeyType.PARTITIONED)
    private Boolean active;
    @PrimaryKeyColumn(type = PrimaryKeyType.CLUSTERED, ordinal = 1)
    private String countryCode;
    private String description;
}
class CenterKey extends BasicMapId {
 ... 
}

When providing List<CenterKey> to the dleteAllById, i found that only first element was deleted.

I belive this issue is in SimpleReactiveCassandraRepository, where, if using composite key, we provide Flux publisher to the method, deleteById, but this method later does Mono.from(publisher).

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 22, 2022
@mp911de mp911de self-assigned this Aug 22, 2022
@mp911de mp911de added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Aug 23, 2022
@mp911de mp911de changed the title deleteAllById removing only first element SimpleCassandraRepository.deleteAllById removing only first element Aug 23, 2022
@mp911de mp911de added this to the 3.4.3 (2021.2.3) milestone Aug 23, 2022
mp911de added a commit that referenced this issue Aug 23, 2022
We now correctly delete all elements when using composite keys (MapId, Primary Key classes). Previously, we did not support that case or removed only the first element.

Closes #1298
@mp911de
Copy link
Member

mp911de commented Aug 23, 2022

That's fixed now.

@Veermove
Copy link
Author

Great. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants