-
Notifications
You must be signed in to change notification settings - Fork 120
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
Using or in Query with link #546
Comments
after trying to test many cases I think the issue is in using or it, not the isNull() QueryBuilder<OrderModelDto> queryBuild= _dbController.box<OrderModelDto>().query(OrderModelDto_.businessDate
.equals(orderFilter.businessDate!.millisecondsSinceEpoch)
.or(OrderModelDto_.sessionUid.isNull()));
queryBuild.link(OrderModelDto_.orderType, OrderTypeDto_.id.equals(5));
QueryBuilder<OrderModelDto> queryBuild= _dbController.box<OrderModelDto>().query(OrderModelDto_.businessDate
.equals(orderFilter.businessDate!.millisecondsSinceEpoch)
.or(OrderModelDto_.sessionUid.equal("notFound")));
queryBuild.link(OrderModelDto_.orderType, OrderTypeDto_.id.equals(5)); both code samples above returned the same result I also tried to use a single condition with link and isNull and the result was correct QueryBuilder<OrderModelDto> queryBuild= _dbController.box<OrderModelDto().query(OrderModelDto_.sessionUid.isNull());
queryBuild.link(OrderModelDto_.orderType, OrderTypeDto_.id.equals(5)); |
Thanks for reporting. However, without knowing what data you are working with it's hard to guess what you expect to be the correct result. Maybe note that "link" conditions are always added with "and". If that does not clear things up, please share a small example project to help me understand your issue better. |
Thanks for replaying. I have created a small example project with the case https://github.com/mahmoud-araby/object_boc_relation_test Steps To Reproduce : Try to Put Total And Discount more significant than the data in Tables with Specific User Name but Query still returns all data with Link to the User Name. |
Thanks! I can confirm that when adding the link condition it appears the actual conditions are ignored completely. Log output:
We'll look into this. |
We have released version Thanks again! |
If add a link, backLink in QueryBuilder and add or() in entity condition ( not the linked entity ) returned result using find, findAsync is not accurate
following the returned data if think that return is like executing the main condition and the link in two separate functions.
Basic info:
Steps to reproduce
Expected behavior
the returned result must be a and between a link and a specific condition as explained in the doc :
but the query returns all results from the link and condition as if they are executed separately.
Code
The return data count is greater than the condition itself without a link as if the link is not looking anymore at the condition on OrderModelDto
The text was updated successfully, but these errors were encountered: