Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Can't use same class name (but in different packages) for entities in ToOne relations #744
The bug (or error) is encountered when using two different entity classes in ToOne relations, but the classes have the same name, although in different packages.
The error is quite weird and is printed at build time:
The workaround I found was to simply change one of the PaymentMethod-classes names to for example CustomerOrderPaymentMethod. But this should not be needed since the two classes are distinct; indeed their full names are not PaymentMethod but
Thanks in advance and thanks for a great library!
Thanks for reporting. ObjectBox uses the simple class name to uniquely identify an entity, it does not differentiate by package name. So as you did make sure each entity class has a unique name.
The error is misleading, the processor does not detect and error correctly if another entity of the same name is found. We should change that.
Also: there is a newer version of ObjectBox available.