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

Fix for ensureIndexes() logic #1211

Merged
merged 3 commits into from
Sep 24, 2018
Merged

Fix for ensureIndexes() logic #1211

merged 3 commits into from
Sep 24, 2018

Conversation

darklynx
Copy link
Contributor

@darklynx darklynx commented Nov 9, 2017

This pull-request should fix the issue #1175

With this fix indexes from sub-classes will not be propagated on embedded field of a definite class and hence it will not raise an exception during key calculation. This should not break anybodies implementation since creation of indexes in such scenario is blocked anyway (see related issue #1175).

The indexes from sub-classes will be still propagated if class of embedded field is an interface or an abstract class, which make sense in its own way and it does not break key calculation logic. See corresponding integration test IndexHelperTest.createIndex() where 6 indexes are expected, only 4 indexes are declared in direct classes 1 index is declared in parent class and 1 index is declared in sub-class.

@evanchooly evanchooly added this to the 1.4.0 milestone Sep 24, 2018
@evanchooly evanchooly merged commit 540717f into MorphiaOrg:master Sep 24, 2018
VPriesnitz pushed a commit to VPriesnitz/morphia that referenced this pull request Oct 5, 2018
* added integration tests to confirm the issue MorphiaOrg#1175

* collect indexes from subclasses only if field is an interface or abstract class

* fixed errors reported by checkstyle
@evanchooly evanchooly modified the milestones: 1.4.0, 1.5.0 Oct 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants