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

findAllById broken when using MapIdCassandraRepository [DATACASS-661] #833

Closed
spring-projects-issues opened this issue May 30, 2019 · 2 comments

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented May 30, 2019

Paul Bakker opened DATACASS-661 and commented

When using a MapIdCassandraRepository the "findAllById" method throws the following: 

ava.lang.IllegalStateException: Required identifier property not found for class ... 

I've reproduced this in a test case: https://github.com/paulbakker/spring-data-cassandra/blob/multi-primary-key-repo-findall/spring-data-cassandra/src/test/java/org/springframework/data/cassandra/repository/mapid/RepositoryMapIdIntegrationTests.java#L115


Backported to: 2.1.9 (Lovelace SR9)

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented May 31, 2019

Mark Paluch commented

There are actually two issues:

  1. findAllById is a batch operation performing an IN query. These type of queries are only possible with singular Id fields and not composite keys.
  2. Creating queries using MapId is broken when using SimpleCassandraRepository.findAllById because it's not evaluated properly

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jun 5, 2019

Mark Paluch commented

Imperative repositories now reject composite MapId keys. Reactive repositories optimize for batching if possible and fall back to one-by-one loading (as previously done)

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