New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Polymorphic entities #5
Comments
Creating schema for such entities looks quite complicated. How database should handle object of previously unknown subclass with many new fields? |
I would put it at the end of backlog, we can live without polimorfic types. |
|
@YuriDenison Can you give an example why one would used sealed classes as entities? |
Simple example
It would be nice to be able to create Destination box and make queries like 'get all destinations ordered by createdAt' |
[Offtop] Why do you need |
What about this issue? any updates? |
So important to the correct usage of the library my friends. You have to fix it :) |
This will introduce complexity quite a bit. Other features have a better value/cost ratio. Thus we'll put that feature a bit further down in the backlog so you know what to expect. |
Ok |
Update: ObjectBox 1.4 introduces (non-polymorphic) entity inheritance. You can check it out it now using version 1.4.0-RC and also have a look at the docs. |
I have a reversed problem I'm trying to solve: I want to store subclass entities (which have 20+ fields) and be able to retrieve both subclass entities (with all the fields) and baseclass entities (only 5 fields). Is it possible to achieve using current Inheritance implementation? The reason for this is that we have a lot of data, and each entry takes 1-2Kb of memory. On devices with limited amount of memory, we want to have a slimmed-down version of the object with only essential fields (5 fields). |
really sad because this issue is low priority. I think inheritance is a very common design pattern and should have a higher priority. |
@nguyenxndaidev Entity inheritance (with limitations) is available since ObjectBox 1.4. Please share what you need that is not supported right now. |
Below is an example that doesn't work:
It is nice if these things are supported
Workaround in my project
|
Allow subclassing of entities.
Affects:
The text was updated successfully, but these errors were encountered: