Skip to content

QueryDSL-style queries don't honor targetType @Field attribute #4359

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
onmishkin opened this issue Apr 7, 2023 · 2 comments · May be fixed by #4382
Open

QueryDSL-style queries don't honor targetType @Field attribute #4359

onmishkin opened this issue Apr 7, 2023 · 2 comments · May be fixed by #4382
Assignees
Labels
status: feedback-provided Feedback has been provided type: bug A general bug

Comments

@onmishkin
Copy link

I have a @Document class, Foo with a field like this:

@Field(value = "bar", targetType = FieldType.OBJECT_ID)
String bar;

I'm using QueryDSL so I also end up with a QFoo generated class. In another class, I have a field r whose type is a @Repository interface R that implements QuerydslPredicateExecutor.

When I call r.findAll(QFoo.foo.bar.eq("...") I expect the "..." to be converted to an ObjectId as part of the construction of the MongoDB query but instead it gets passed through as a string--i.e., the query looks like:

{bar: "..."}

so the query doesn't work as expected.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Apr 7, 2023
@mp911de mp911de added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Apr 17, 2023
@christophstrobl
Copy link
Member

sorry for long silence. What version of data-mongo are you referring to please? Everything seems to work as designed on current main.

@christophstrobl christophstrobl added the status: waiting-for-feedback We need additional information before we can continue label Aug 29, 2023
@onmishkin
Copy link
Author

I observed the problem on version 3.4.2.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Aug 29, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
status: feedback-provided Feedback has been provided type: bug A general bug
Projects
None yet
4 participants