-
Notifications
You must be signed in to change notification settings - Fork 126
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
Associated object query #694
Comments
What you are looking for a probably "link" queries, see https://docs.objectbox.io/queries#query-a-related-entity-links for an example. Note: I labeled this issue with "more info required" so it will auto-close in a few days if there are no follow-up comments. |
Need to query current object parameters, with associated object parameters, hybrid query. It is now the associated object that is separate from the current object query. |
final query1 = FLStorageObjectBox.box<TaskModel>().query(TaskModel_.ownerId.equals(OwnerId!) & TaskModel_.timeAt
.greaterOrEqualDate(selectDate.startOfDay)
& TaskModel_.timeAt.lessOrEqualDate(selectDate.endOfDay));
final query2 = FLStorageObjectBox.box<TaskModel>().query(TaskModel_.ownerId.equals(OwnerId!) & TaskModel_.timeAt
.lessThanDate(selectDate.startOfDay) & TaskModel_.repeatConfig.notNull());
query2.link(TaskModel_.repeatConfig,
(TaskConfigModel_.endAt.isNull() | TaskConfigModel_.endAt.greaterOrEqualDate(selectDate.endOfDay)) &
(TaskConfigModel_.repeatType.equals(1) | (TaskConfigModel_.repeatType.equals(2) & TaskConfigModel_.repeatWeeksValue.equals(1)))
); Can not query the data in a method, divided into multiple and can not listen and sort, what method can solve this problem, if the Condition class can continue to handle the associated object query, this problem can be solved |
See https://docs.objectbox.io/data-observers-and-rx#flutter-dart and https://docs.objectbox.io/queries#order-results Edit: I also added a link in the documentation to make this easier to find: https://docs.objectbox.io/queries#observe-or-listen-to-changes |
Filtering of related objects like this, cannot be transferred to objectbox, can not be satisfied, hope to correct
The text was updated successfully, but these errors were encountered: