Is there a difference on how tags can be inherited?
At beginning I was always declaring the property/field tags on every entity.
Then I see some very repetitive ones, that I moved to an ancestor, that is not an entity, but a common base class for my entities.
I have found that the entities with the tag [inheritance] does not inherited the properties tagged on my base class.
However the entity that is using inheritance tag get properties from the base class.
Is it the expected behavior, or am i doing something wrong?
Aurelius attributes should be added on entity classes only (classes with [Entity] attribute). Adding attributes to other classes are not supported, thus the behavior is not predictable for now.
hmm, I thought that was allowed since the other properties that are not mapped are inherited on TAureliusDataset.
So, if I tag my base class as [entity] but does not add the [inheritance] on the descendants should work?
I want a base class for common helper functions and table fields. This base class is not a table itself. I am trying to think in the way OOP should be and persist at the level needed.
TAureliusDataset is different because it sees the object, not the mapping. You can even use non-mapped properties with TAureliusDataset. It's more related to editing the object (in memory), persistence is another story.
Attributes/persistence mechanism cannot be completely related to OOP. Usage is OOP, but not persistance, since it's db-related. The best example is joined tables inheritance. You have each property being persisted in a different table, depending on the class the persistence attribute is declared. So it's not the same thing, and Aurelius must know the class where the persistence (attribute) is defined to know how to behave.
Well, but it is working, and only in one case is not.
My idea here was to keep the template pattern, I want to use Aurelius in a way that I can keep the table out of my mind.
If I just add the [entity] tag o this base class works?
"So it's not the same thing, and Aurelius must know the class where the persistence (attribute) is defined to know how to behave."
It is already working, only on the case of Table Inheritance it does not for some reason.
I will revert my code to not use this, however I believe that usage as a template class would be interesting.
Thing is we didn't design it for this, and thus we didn't test it (or add checks). So it might work or not by "luck". It probably doesn't work with inheritance because in this case, as I said, it needs to know exactly in which class the attribute was declared. This is something we might consider, but it's not trivial for us because it can break backward compatibility badly and it needs to be very well thought and tested.