List and Inheritance issue ?

Sorry but this message should be transferred to X-Data forum

I've just seen the $expand query option.

This could be a drawback, when using $expand you have to know all properties and subproperties. Wouldn't make sense to have an $expandall query option ?

Inheritance issue is still remaining.

That's now how Aurelius mapping works. You have to put all your mapping in the entity that is persisted. Aurelius does support inheritance, but for persisted classes (for example, if TRecordINfo and TInfoScanne were also persistent). There is no concept of mapping in non-persisted classes, so you have to redeclare the properties you want to persist in class TPalette and map them there.


When you mean "Persisted", do you mean a class set with attribute [Entity] ?
If I redeclare all these properties, doesn't this defeats the class inheritance mechanism ?

Yes, I mean [Entity] attribute with means objects of that class will be persistent and you'd have to define an [Inheritance] attribute in this case to define the inheriting system.

The redeclaration of properties is just to add the mapping. You won't defeat the inheritance mechanism because the properties will still be in the base class:

[Column('DEVICE', [TColumnProp.Required])
property Device;

It's just for add the mapping info.

What I fear is to forget to redeclare an inherited property in my descendant class. I'm saying this because Aurelius will persist them in my DB but X-Data will not be able to fetch

I really don't know how much work this represent but can this behaviour change ? I think it is not a good practice to
redeclare these properties. In my example (project I sent you) , all my parent class does have the [AutoMapping]
attribute set (but no [Entity] attribute as I don't want them to be saved).

Aurelius will not "persist" - currently Aurelius behavior is not predictable. Neither Aurelius or XData work that way. This is how it's supposed to be, because you can, for example, have different column names or table names for descendent classes, because the ancestor is not being saved.

You are not changing or duplicating code when it comes to OOP - you are just providing the mapping information which can be different for each descendant.