First some background: a many-to-many relation in the ObjectBox database holds its data "outside" of the entities (in a separate data "bucket"; the pendant to a "table" of a relational database).
Thus, that relation annotation is already sufficient.
You did not indicate which language you are using, but both C and C++ ObjectBox APIs do not have wrapper types for relations (e.g. lists as used in higher level languages). Instead, you must use the low-level functions obx_cursor_rel_put
, obx_cursor_rel_remove
, and obx_cursor_rel_ids
. Or, the box-based functions like obx_box_rel_put
.
To give you an impression, check the following gist: https://gist.github.com/greenrobot/552f560a92737ec045b0efdc2122fd62 - you cannot run it as because it lacks the testing context, but should give you an idea of how to use it.