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

Reorder documentation of class-based projection support for JPA Native Queries #3599

Closed
mipo256 opened this issue Aug 28, 2024 · 3 comments
Closed
Assignees
Labels
type: documentation A documentation update

Comments

@mipo256
Copy link

mipo256 commented Aug 28, 2024

I've created a demo project to demonstrate the problem. It seems that only interface based projections are working fine, but if we want to use class based projections, we have the ConverterNotFoundException problem. Related Stack Overflow thread.

It is expected that the Class Based Projections would work for native queries, as stated in the doc. Well, the doc does not mention specifically that Class Based Projections would work for native queries, but on the contrary it does not mention for what queries it would work, so the assumption is that for all @Query methods.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 28, 2024
@mp911de
Copy link
Member

mp911de commented Aug 28, 2024

You find the specifics at the end of the document:

And it’s important to point out that class-based projections do not work with native queries AT ALL. As a workaround you may use named queries with ResultSetMapping or the Hibernate-specific ResultListTransformer

This section comes below Dynamic Projections

@mipo256
Copy link
Author

mipo256 commented Aug 28, 2024

Okay, thanks, found it, but nevertheless, I would expect this restriction under class based projection section, not under dynamic projection (to me seems to be far more decent), and honestly, it's not the first time we encounter this issue and according to Stack Overflow discussion, we're not alone.

Any plans to implement this? Should be technically possible since Spring Data JDBC has no problem with class based projections.

@mp911de mp911de changed the title Class Based Projection for JPA Native Queries Reorder documentation of class-based projection support for JPA Native Queries Aug 29, 2024
@mp911de mp911de added type: documentation A documentation update and removed status: waiting-for-triage An issue we've not yet triaged labels Aug 29, 2024
@mp911de mp911de added this to the 3.2.10 (2023.1.10) milestone Aug 29, 2024
@mp911de
Copy link
Member

mp911de commented Aug 29, 2024

I reordered the documentation to find the limitation much earlier.

@mp911de mp911de self-assigned this Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: documentation A documentation update
Projects
None yet
Development

No branches or pull requests

3 participants