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

Projection Column Mapping Issue [DATACMNS-927] #1380

Closed
spring-projects-issues opened this issue Oct 11, 2016 · 3 comments
Closed

Projection Column Mapping Issue [DATACMNS-927] #1380

spring-projects-issues opened this issue Oct 11, 2016 · 3 comments
Assignees
Labels
status: duplicate type: bug

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Oct 11, 2016

Michael Gmeiner opened DATACMNS-927 and commented

There seems to be a bug within the projection implementation. I have a native query which result i want to map with projection to a interface. The interface has three getters which have the exact name as the returned columns by the native query. The result is now that the columns are mapped into the wrong properties in the interface (or its proxy).

I found that the problem may be in ResultProcessor Line 262 when the names get mapped to the columns. The names are in a wrong order. This wrong order is already present when the PropertyDescriptor instances are retrieved from the interface in DefaultProjectionInformation Line 48.

Hope this helps :)


Affects: 1.12.4 (Hopper SR4)

Issue Links:

  • DATAJPA-980 Projections with native queries don't work as expected
    ("duplicates")
@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Oct 11, 2016

Oliver Drotbohm commented

This suspiciously sounds like a duplicate of the just filed DATAJPA-980

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Oct 11, 2016

Michael Gmeiner commented

Yes it's a duplicate of the mentionend issue of you. Seems like Robert Hunt and me had the same issue at the same time :D

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Oct 11, 2016

Oliver Drotbohm commented

I just checked and it's definitely the way, Spring Data JPA executes the native query currently. We're getting back a plain list only where actually a Map is expected, as that would allow us a proper mapping of property names to columns returned

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

No branches or pull requests

2 participants