silverqx / TinyORM

Modern C++ ORM library
https://www.tinyorm.org
MIT License
242 stars 25 forks source link

Polymorphic inheritance loading #54

Closed edubois closed 2 weeks ago

edubois commented 1 month ago

Hi,

Assuming I have a base class IVehicule and I have Car inheriting from IVehicule. Let's say I have a table User referencing a relation one-to-many to IVehicule and I inserted an Car as child to User. How can I load all IVehicule relation objects even if they actually are Car?

Do I have to make multiple relations for each derived types (User::listCars, User::listTrucks, ....)? or is there a more elegant way using the base class IVehicule?

Thanks!

silverqx commented 1 month ago

No Inheritance mapping or polymorphic relations are not supported, I never used these types of relations and don't plan to add support for them in the near future.