objectbox / objectbox/objectbox-java
Eager multiple entities across relations
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 4.6k
- Forks
- 311
- PR merge metrics
- No merged PRs in 30d
Description
A{
ToMany<B> list;
}
B{
ToOne<C> c;
}
C{
...
}
The relationship of ABC is 1:N:1
store.boxFor(A.class).query().eager(A_.list).build().find()
Using the above method, I cannot immediately fill in the contents of C.
store.boxFor(A.class).query().eager(A_.list,B_.c).build().find()
This will give an error
A cannot be cast to B
Question:
With eager, how can I get all the data of the associated table?
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 by reproducing the A→B→C 1:N:1 relationship and the two eager queries shown in the issue. Inspect the eager-loading entry point and relation traversal that produces the “A cannot be cast to B” error. Done means a supported query can eagerly populate C through B, or the limitation is clearly documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100