Skip to content

querydsl predicate using IN operator returns no results with @DBRef #4716

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

Closed
hhamzic1 opened this issue Jun 5, 2024 · 3 comments
Closed
Assignees

Comments

@hhamzic1
Copy link

hhamzic1 commented Jun 5, 2024

I'm having this setup:

public class BulkEntity {

    @Id
    private String id;

    @NotNull
    private Long bulkId;

    @NotNull
    private String bulkName;

    @NotNull
    @DBRef
    private OperatorEntity operator;
}

and

public class OperatorEntity {

    private String id;

    @NotNull
    private String name;
}

the corresponding QBulkEntity and QOperatorEntity classes are generated and I see no problem with them, but when I try to call bulkRepository.findAll with predicate that uses IN operator it doesn't work (returns no results)

example:

var operatorIds = List.of("6659aaf9e6f5547ba1e1aca5", "6659aaf9e6f5547ba1e1aca7");
var operatorIdPath = Expressions.stringPath("operator.id");
var predicate = operatorIdPath.in(operatorIds);
var entityPage = bulkRepository.findAll(predicate);

entityPage returns no result, even though entities with the ID's are present in 'operators' collection.

Is this an issue or I'm doing something wrong?

I found similar ticket that explains this problem back in 2017

versions that I use are:

spring-boot-starter-data-mongodb (3.3.0)
querydsl-mongodb (5.1.0)
querydsl-apt (5.1.0)
morphia (1.3.2)
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 5, 2024
@christophstrobl
Copy link
Member

thanks for reporting - to speed things up a bit, do you have a complete minimal sample (something that we can unzip or git clone, build, and deploy) that reproduces the problem?

@christophstrobl christophstrobl added status: waiting-for-feedback We need additional information before we can continue and removed status: waiting-for-triage An issue we've not yet triaged labels Jun 11, 2024
@christophstrobl christophstrobl self-assigned this Jun 11, 2024
@spring-projects-issues
Copy link

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

@spring-projects-issues spring-projects-issues added the status: feedback-reminder We've sent a reminder that we need additional information before we can continue label Jun 18, 2024
@spring-projects-issues
Copy link

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

@spring-projects-issues spring-projects-issues closed this as not planned Won't fix, can't repro, duplicate, stale Jun 25, 2024
@spring-projects-issues spring-projects-issues removed status: waiting-for-feedback We need additional information before we can continue status: feedback-reminder We've sent a reminder that we need additional information before we can continue labels Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants