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

FindAndUpdate broken when using @DbRef and interface as target [DATAMONGO-897] #1823

Closed
spring-projects-issues opened this issue Apr 1, 2014 · 3 comments
Assignees
Labels
in: core Issues in core support in: mapping Mapping and conversion infrastructure type: regression A regression from a previous release

Comments

@spring-projects-issues
Copy link

Lauri Kimmel opened DATAMONGO-897 and commented

NullPointerException is thrown when using MongoTemplate.findAndModify(...) with @DbRef and interface as @DbRef target. See attached project for more details. Probably regression issue since same test is passing with Spring Data Commons 1.6.3.RELEASE and Spring Data MongoDB 1.3.3.RELEASE.


Affects: 1.4.1 (Codd SR1)

Attachments:

Referenced from: pull request #164

Backported to: 1.4.2 (Codd SR2)

@spring-projects-issues
Copy link
Author

Christoph Strobl commented

In 1.4 DBRef resolution in QueryMapper changed in a way that tries to inspect if the properties Id can be assigned to the given type. When one passes in an Update it is most likely not to have all type information at hand, which means in case of an property pointing to an interface that the entire resolution might have failed.

In 1.5 it`s possible to resolve properties on interfaces as long as those follow the beans convention. But it failed, as it does in 1.4.x, for those properties not having the required getters

@spring-projects-issues
Copy link
Author

Oliver Drotbohm commented

I've force-pushed the branch to rebase it against the latest changes? Any chance we can get a test case on the QueryMapper level instead of the one in MongoTemplateTests. The latter is more and more becoming some kind of kitchen sink for all sorts of tests for changes that seem to be totally unrelated to actual type

@spring-projects-issues
Copy link
Author

Christoph Strobl commented

sure. good point - moved test from MongoTemplateTests to UpdateMapperUnitTests

@spring-projects-issues spring-projects-issues added type: regression A regression from a previous release in: core Issues in core support in: mapping Mapping and conversion infrastructure labels Dec 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core support in: mapping Mapping and conversion infrastructure type: regression A regression from a previous release
Projects
None yet
Development

No branches or pull requests

2 participants