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

Repository queries with IN filters fail with empty input list [DATAES-937] #1512

Closed
spring-projects-issues opened this issue Sep 24, 2020 · 5 comments

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Sep 24, 2020

Stefan Baur opened DATAES-937 and commented

If you call AbstractElasticsearchRepository.findAllById(new ArrayList<>()), you get the following error: 

Caused by: java.lang.IllegalArgumentException: No Id define for Query 
at org.springframework.util.Assert.notEmpty(Assert.java:467) 
at org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate.multiGet(ElasticsearchRestTemplate.java:173) 
at org.springframework.data.elasticsearch.repository.support.AbstractElasticsearchRepository.findAllById(AbstractElasticsearchRepository.java:162) 

 

The documentation of CrudRepository#findAllById interface defines this: 

If some or all ids are not found, no entities are returned for these IDs.

 

I expect this query to return an empty result and not to throw a runtime error.

 

This problem also applies to custom repository methods that use WhereXYIn filters like:

MyElasticRepository.findAllByNameIn(new ArrayList<>())


Affects: 4.0.4 (Neumann SR4)

Referenced from: pull request #525

Backported to: 4.0.5 (Neumann SR5), 3.2.11 (Moore SR11)

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Sep 25, 2020

sothawo commented

Oliver Drotbohm or Mark Paluch can one of you please delete that spam-attachment? I have not the rights to do so

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Sep 25, 2020

Oliver Drotbohm commented

Done

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Sep 25, 2020

sothawo commented

Oliver Drotbohm is it possible to block this spammer? got one of these spams again

 

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Sep 25, 2020

Oliver Drotbohm commented

I've informed the admins

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Sep 25, 2020

sothawo commented

looking at the systems dashboard this is just happening across different projects as well. Is there a possibility to give admin rights to manage attachments only for one repository? Then I could keep this one clean

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
1 participant