Skip to content

JdbcAggregateOperations does not use columns parameter of Query #1803

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
Jul13nT opened this issue Jun 3, 2024 · 1 comment
Closed

JdbcAggregateOperations does not use columns parameter of Query #1803

Jul13nT opened this issue Jun 3, 2024 · 1 comment
Assignees
Labels
type: bug A general bug

Comments

@Jul13nT
Copy link

Jul13nT commented Jun 3, 2024

With Spring Data JDBC (Spring Boot 3.3.0), when using JdbcAggregateOperations.findAll API with a Query object, the columns parameter of the query is not respected. When I specify some columns in the query, the returned object should have only theses properties populated. The logged query shows that Spring Data JDBC is using all columns in the select part.

I have made a reproduction repo: https://github.com/Jul13nT/spring-data-jdbc-query-columns
You can run the CustomerRepositoryTest to see the problem.

This works fine with Spring Data R2DBC with R2dbcEntityTemplate.select.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 3, 2024
@mp911de mp911de added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Jun 10, 2024
@stormlei
Copy link

I also encountered the same problem

schauder added a commit that referenced this issue Jan 2, 2025
If no columns are given, all columns are selected by default.

If columns are specified, only these are selected.
Joins normally triggered by columns from 1:1 relationships are not implemented, and the corresponding columns don't get loaded and can't be specified in a query.

Limiting columns is not supported for single query loading.

Closes #1803
schauder added a commit that referenced this issue Jan 15, 2025
If no columns are given, all columns are selected by default.

If columns are specified, only these are selected.
Joins normally triggered by columns from 1:1 relationships are not implemented, and the corresponding columns don't get loaded and can't be specified in a query.

Limiting columns is not supported for single query loading.

Closes #1803
@mp911de mp911de added this to the 3.5 M1 (2025.0.0) milestone Jan 16, 2025
schauder added a commit that referenced this issue Jan 20, 2025
Query columns now get checked against property names.
If such a property name is found, the property is used.
Otherwise the column is considered a literal column and used as is in the SQL generation.

Original pull request #1967
See #1803
schauder added a commit that referenced this issue May 26, 2025
If no columns are given, all columns are selected by default.

If columns are specified, only these are selected.
Joins normally triggered by columns from 1:1 relationships are not implemented, and the corresponding columns don't get loaded and can't be specified in a query.

Limiting columns is not supported for single query loading.

Closes #1803
schauder added a commit that referenced this issue May 26, 2025
Query columns now get checked against property names.
If such a property name is found, the property is used.
Otherwise the column is considered a literal column and used as is in the SQL generation.

Original pull request #1967
See #1803
@mp911de mp911de self-assigned this Jun 11, 2025
mp911de pushed a commit that referenced this issue Jun 11, 2025
If no columns are given, all columns are selected by default.

If columns are specified, only these are selected.
Joins normally triggered by columns from 1:1 relationships are not implemented, and the corresponding columns don't get loaded and can't be specified in a query.

Limiting columns is not supported for single query loading.

Closes #1803
mp911de pushed a commit that referenced this issue Jun 11, 2025
Query columns now get checked against property names.
If such a property name is found, the property is used.
Otherwise the column is considered a literal column and used as is in the SQL generation.

Original pull request #1967
See #1803
@mp911de mp911de changed the title JdbcAggregateOperations does not use columns parameter of Query JdbcAggregateOperations does not use columns parameter of Query Jun 13, 2025
@mp911de mp911de added type: bug A general bug and removed type: enhancement A general enhancement labels Jun 13, 2025
mp911de pushed a commit that referenced this issue Jun 13, 2025
If no columns are given, all columns are selected by default.

If columns are specified, only these are selected.
Joins normally triggered by columns from 1:1 relationships are not implemented, and the corresponding columns don't get loaded and can't be specified in a query.

Limiting columns is not supported for single query loading.

Closes #1803
Original pull request: #1967
mp911de added a commit that referenced this issue Jun 13, 2025
Resolve mapped property paths to aggregate paths. Add tests.
Clean up unused profile declarations.

See #1803
Original pull request: #1967
mp911de added a commit that referenced this issue Jun 13, 2025
Resolve mapped property paths to aggregate paths. Add tests.
Clean up unused profile declarations.

See #1803
Original pull request: #1967
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

Successfully merging a pull request may close this issue.

4 participants