objectbox / objectbox-generator

ObjectBox Generator based on FlatBuffers schema files (fbs) for C and C++ (more languages in the future)
https://objectbox.io
GNU Affero General Public License v3.0
36 stars 11 forks source link

C++ One to many relationship #49

Open ottolewis8 opened 1 year ago

ottolewis8 commented 1 year ago

The C++ docs are sparse, how do you make a one to many relationship? I get error: parentid: unsupported vector element type: ULong Looking at: https://github.com/objectbox/objectbox-generator/blob/main/test/comparison/testdata/fbs/typeful/schema.fbs only string and byte are supported? ` table Slot { /// objectbox:id id : ulong;

defaultlinkoffset : int32;

/// objectbox:relation=Device parentid : [ulong;] // Does not work } table Device { /// objectbox:id id : ulong; hid : string; } `

greenrobot commented 1 year ago

A 1:N relationship needs an ID (not a vector of IDs) at the "1" side of 1:N.

ottolewis8 commented 1 year ago

Thanks that can work are there any plans to support vectors of int32/64 as only byte, ubyte and string are supported for C++?