sai-pullabhotla / catatumbo

JPA like Persistence Framework for Google Cloud Datastore and Cloud Firestore
http://catatumbo.io
Apache License 2.0
51 stars 20 forks source link

Support for Polymorphism #180

Open davidjoh0 opened 7 years ago

davidjoh0 commented 7 years ago

Hi,

Does/will catatumbo support polymorphism, so that we can define a polymorphic hierarchy of related entity classes, and then load and query them without knowing the specific subtype?

Similar to objectify: https://github.com/objectify/objectify/wiki/Entities#polymorphism

Many thanks,

David

sai-pullabhotla commented 7 years ago

@davidjoh0 - Currently Catatumbo does not support what Objectify does - store related entities as 'One Kind' in the Datastore.

Entities in Catatumbo can extend from a MappedSuperClass, but each concrete entity is mapped to its own Kind in the Datastore. Not sure if that works for you. I will mark this as an enhancement request.

davidjoh0 commented 7 years ago

@sai-pullabhotla many thanks for the quick response; annotating the concrete classes will work for us.