Closed Divya21 closed 4 years ago
If you only want to store IDs you have to do it yourself. With ObjectBox, there are relations. In this case adding ToMany<A>, ToMany<B>
, etc. to MemberTable would work.
https://docs.objectbox.io/relations
If you only want to store IDs you have to do it yourself. With ObjectBox, there are relations. In this case adding ToMany, ToMany, etc. to MemberTable would work. https://docs.objectbox.io/relations
I have to use List of Int for this, I have seen it has been added to features in 2016(link is below). So is there any way? https://github.com/objectbox/objectbox-java/issues/7#issue-202969381
You would have to write a custom converter for this. https://docs.objectbox.io/advanced/custom-types
Alternatively, use ToMany<A>
anyhow. But get the list of IDs of the related entities using Box.getRelationIds(MemberTable_.toManyOfA, memberTable.memberId)
.
https://github.com/objectbox/objectbox-java/blob/220fc35ef296b9957a29207596abf8c1313dfcb5/objectbox-java/src/main/java/io/objectbox/Box.java#L657
You would have to write a custom converter for this. https://docs.objectbox.io/advanced/custom-types
Alternatively, use
ToMany<A>
anyhow. But get the list of IDs of the related entities usingBox.getRelationIds(MemberTable_.toManyOfA, memberTable.memberId)
. https://github.com/objectbox/objectbox-java/blob/220fc35ef296b9957a29207596abf8c1313dfcb5/objectbox-java/src/main/java/io/objectbox/Box.java#L657
Thanks a lot!
I have 4 entities(4 tables) and I want to use multiple entities ids in another entity. How to inherit it. Please help!