objectbox-java
objectbox-java copied to clipboard
Combine Query links with or()
@Entity
public class Note {
@Id public long id;
public String title;
public ToMany<Tag> tags;
}
@Entity
public class Tag {
@Id public long id;
public String description;
public String description2;
}
How to query and return all the results that match the query entered by the user?
noteBox.query()
.equal(Note_.title, queryString)
.link(Note_.tags)
.or()
.equal(Tag_.description, queryString)
.or()
.equal(Tag_.description2, queryString)
.build()
.find();
Not working
or
condition is currently not supported for 'link' - good point...
It will be included in 2.0?
Didn't make it into 2.0, but should be part of a 2.1-ish release.
???
Sorry to ask, but are you planning to implement this option? That's what we really miss.
Bump
Same issue here; I know the workaround is to aggregate results post-query (and I did that). However, it's still the DBMS' job !
Same issue here; I know the workaround is to aggregate results post-query (and I did that). However, it's still the DBMS' job !
Agreed, I wrote my own aggregation functionality and it still annoys me.
Wonder when that "2.1-ish" will be released, given that 3.0.0 is already released.
I am using version 3.1.0 and I still have this problem. It is really strange that the ObjectBox
does not support this. This type of query is very common!
q.link(Trx_.fromAccount).link(Trx_.toAccount)
.apply(TrxAccount_.name.oneOf(filterOptions.account.toTypedArray()))
I wonder how to do this! Can't proceed without it...
Any Idea if its implemented? if not any workaround ?
Combining conditions with or is only supported on the parent object at this point.
If you want us to support combining conditions using or of related objects ("link queries") thumbs up the first comment!