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

@Query annotated repository query fails to map complex Id structure. [DATAMONGO-1078] #1998

Closed
spring-projects-issues opened this issue Oct 28, 2014 · 2 comments

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Oct 28, 2014

Christoph Strobl opened DATAMONGO-1078 and commented

StringBasedMongoQuery converts any complex object to the according mongo type including type restrictions via _class. Therefore annotated queries like:

@Query("{'_id': {$in: ?0}}")
List<User> findByUserIds(Collection<MyUserId> userIds);

end up being converted to:

{_id:  {$in: [ {_class:"com.sampleuser.MyUserId", userId:"....", sampleId:"...."}, ...

So we need to check for the presence of typeKey when converting id properties


Affects: 1.5.4 (Dijkstra SR4), 1.6 GA (Evans)

Reference URL: http://stackoverflow.com/questions/26596007/spring-mongorepository-query-adding-class-field-to-queries

Issue Links:

  • DATAMONGO-1088 @Query $in does not remove "class" property on collection of embedded objects
    (
    "is duplicated by"_)

Referenced from: pull request #239

Backported to: 1.6.2 (Evans SR2), 1.5.5 (Dijkstra SR5)

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Nov 10, 2014

Christoph Strobl commented

Please reviese. DATAMONGO-1088 seems to be related and passes using the given issue branch

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Nov 10, 2014

Oliver Drotbohm commented

Merged with some polishes. Might wanna check whether that fixes DATAMONGO-1088 as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants