objectbox / objectbox/objectbox-java
Combine Query links with or()
Open
Nobody has claimed this yet.
enhancement
- Dominant language
- Java
- Stars
- 4.6k
- Forks
- 311
- PR merge metrics
- No merged PRs in 30d
Description
@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
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the noteBox.query() chain in the issue, especially the link(Note_.tags) and or() calls. Reproduce the query against the Note and Tag entities using the supplied fields, then determine the expected combined results and verify the behavior with a focused query test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100