Mapping attributes in non-entity classes (like TBaseTable) are ignored. Mapping can only happen in entity classes (those which will effectively be persisted, marked with [Entity] attribute. If you have properties inherited from base non-entity classes, you must redeclare those properties in derived class and add the attribute there:
[Column('ID')]
property Id;
Regarding your second post, it's not clear what's going on. Please take into account that sometimes Aurelius gives the "Id not set" error but that happens because it does not consider the class to be an entity (either because [Entity] attribute is not added to the class, or because you are using different mapping setup or using multi-model design and that class is not present in the mapping explorer you're using).
Unfortunately, this doesn't work. There is no multi-model design, and every 'entity-class' has the [Entity] attribute (and is registered with RegisterEntity)
The error occurs when I list all the records of TPreparations (in which TCharacteristic should be lazy loaded).
Therefore I use a (very simple) repository which does the following...
function TRepository<T>.FindAll: TList<T>;
var
aCriteria: TCriteria;
begin
aCriteria := FManager.Find<T>();
Result := aCriteria.List<T>;
end;
Error occurs when executing the List method.
If it's necessary, I can send you the complete code to investigate.
Filip, yes, please send the code to me through e-mail (wagner at tmssoftware com), I will take a look and let you know what I find out. Just confirming, you did remove the attributes from base class and added the [Id] attribute in the derived class, right?
The issue happening because the entity classes were initializing the proxy association (not many-valued association) to an empty object. That should not be done, associations should just be left untouched (thus having nil value) upon object instantiation.