-
Notifications
You must be signed in to change notification settings - Fork 1.1k
QueryDSL does not work with DBRef [DATAMONGO-362] #1294
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
Comments
Raman Gupta commented Also fails with 1.0-GA |
Xavier Vdb commented I think it will not be easy... mongodb is not relational but it's possible to do that with MapReduce |
Raman Gupta commented Yeah, I think this support has to be added into QueryDSL first, then Spring Data MongoDB can use it... I created querydsl/querydsl#113 to propose this enhancement to the QueryDSL team |
Patryk Wąsik commented This is already implemented in QueryDSL and I can add this to spring data mongo but, I can't figure how. obj1Repo.findOne(QObj1.obj1.obj2Ref.foo.eq("foovalue")) then we have to rewrite Prediction to diffrent query syntax in QueryDSL with is based on joints, and looke like this: query.join(qObj1.obj2Ref,obj2Ref).on(obj2Ref.foo.eq("foovalue")) but this is simply example and prediction can be more complex, so rewriting internaly Prediction to QueryDSL syntax can be pretty complicated. Another solution is to allowing pass QueryDSL Joints to repository method but this is not possible, because this will have to change QueryDslPredicateExecutor interface declaration. Anyone have any idea? |
Timo Westkämper commented What do you think about the explicit joins? It makes the extra queries more explicit and is also for JPQL the preferred way to express joins. You can create your Querydsl queries also directly in Spring Data, so this is just a limitation in the convenience layer |
Patryk Wąsik commented I made initial pull request #13 to solve this |
Christoph Strobl commented Resolved via DATAMONGO-1848. {code:java|title = usage sample}
|
Luis Miguel Ospina commented Christoph Strobl is there any way to use SpringDataMongodbQuery with a pageable instance? Fetch will return a List and there's no such method: .with(pageable) As it is in the Query class |
Christoph Strobl commented @Luis Miguel Ospina Please open a new issue for concerns not directly related to the actual ticket so that others who are interested can find it easily. Thank you!
// ...
.limit(page.getPageSize())
.offset(page.getOffset()); In case you want your method to return a |
Rasool Nasr commented how to use orderBy method of query? orderBy works with main entity very well.but when I use inner field of dbref entity it doesn't work.
for example: |
Raman Gupta opened DATAMONGO-362 and commented
When an object refers to another object with a
@DbRef
, QueryDSL cannot be used to navigate "across" the@DbRef
. For example:obj1Repo.findOne(QObj1.obj1.obj2Ref.foo.eq("foovalue"))
returnsnull
Affects: 1.0.1, 1.1 M1
Issue Links:
("depends on")
Referenced from: pull request #13
2 votes, 7 watchers
The text was updated successfully, but these errors were encountered: