Skip to content
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

JdbcAggregateOperations delete by query #1978

Open
micopiira opened this issue Jan 10, 2025 · 4 comments
Open

JdbcAggregateOperations delete by query #1978

micopiira opened this issue Jan 10, 2025 · 4 comments
Labels
type: enhancement A general enhancement

Comments

@micopiira
Copy link

While comparing R2dbcEntityOperations and JdbcAggregateOperations I noticed that R2dbcEntityOperations has a method to delete entities by query: R2dbcEntityOperations#delete(org.springframework.data.relational.core.query.Query,java.lang.Class) but JdbcAggregateOperations does not.

I'm proposing to add following method to the JdbcAggregateOperations interface:

void delete(org.springframework.data.relational.core.query.Query query, Class<?> domainType);
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 10, 2025
@schauder schauder added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Jan 10, 2025
@ivamly
Copy link

ivamly commented Jan 16, 2025

Hi, @schauder!

Could I work on this? If so, is there any additional information I should know before I start working on it?

Thanks!

@schauder
Copy link
Contributor

Sure, go ahead.

@ivamly
Copy link

ivamly commented Jan 19, 2025

Hi @schauder ! I just wanted to confirm that my understanding of the implementation is correct. Here's what I think needs to be done:

  1. The delete method will be executed via DataAccessStrategy, as all methods that use Query are executed in this way.
  2. We need to add a method in SqlGenerator to generate the SQL query for the delete operation.
  3. A method needs to be added in SqlParametersFactory to retrieve the parameters based on the provided Query.
  4. Finally, we will execute the delete operation via operations.update().

Is my understanding correct? Any advice would be greatly appreciated. Thanks!

@schauder
Copy link
Contributor

Sounds good.

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

No branches or pull requests

4 participants