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 data is not mapped correctly on Hibernate 5.0 [DATAJPA-1309] #1632

Closed
spring-projects-issues opened this issue Apr 2, 2018 · 2 comments
Assignees
Labels
type: bug

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Apr 2, 2018

Phil Webb opened DATAJPA-1309 and commented

Incorrectly mapped values on page summaries.

See spring-projects/spring-boot#12720 for a test that reproduces the error.

The problem seems to come from this line in the test

Page<HotelSummary> hotels = this.repository.findByCity(city,
		new PageRequest(0, 10, Direction.ASC, "name"));

For some reason the HotelSummary seems to have data mapped to the wrong methods. Digging in a bit, the problem appears to be somewhere in org.springframework.data.repository.query.ResultProcessor. Specifically getProjectionTarget is called with a source containing the following:

[Atlanta,GA,USA, Doubletree, 2.0]

And attempts to convert it using toMap. This gets passed the following names:

[averageRating, city, name]

There are not in the same order. Perhaps DefaultProjectionInformation.collectDescriptors is not returning methods in a defined order. Possibly related to SPR-16675?


Issue Links:

  • DATACMNS-1284 Backport ASM-based property detection for projections

Backported to: 1.11.11 (Ingalls SR11)

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Apr 2, 2018

Phil Webb commented

It's not directly related to SPR-16675. Rolling back to SR10 gives a green build

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Apr 3, 2018

Oliver Drotbohm commented

That's resolved with the backport of DATACMNS-1206 tracked in DATACMNS-1284. We strongly recommend to upgrade to a recent Hibernate, even if on Boot 1.5

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

No branches or pull requests

2 participants