Objectbox-java: Combine Query links with or()

Created on 9 Jul 2018  路  7Comments  路  Source: objectbox/objectbox-java

@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

feature

Most helpful comment

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 !

All 7 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

greenrobot picture greenrobot  路  27Comments

LeeKingHung picture LeeKingHung  路  35Comments

DJafari picture DJafari  路  21Comments

arnis71 picture arnis71  路  17Comments

williamwue picture williamwue  路  18Comments