Multiple inheritance strategy with same base class

Hello.


I have base class, described as 

[Entity, Table('schema.global_table')]
[Inheritance(TInheritanceStrategy.JoinedTables)]
TGlobal = class

I have one inherited class

[Entity, Table('schema.joined_table')]
TJoinedGlobal = class (TGlobal)

with own fields in this table.
And, in third, I have an entity, that all field same as TGlobal, in DB stores in as table 'schema.global_name', but have also ManyValue-data in 'schema.third_table'.
I try describe it as 

[Entity]
TThird = class (TGlobal)

, without [Table()] attribute - got an error. 

Describe as
[Table('schema.table_name')]
  • got a error then try to Manager.Save(ThirdObj) - it try to insert twice a record in table.
I want to describe it with inheritance in same table (I have special field in TGlobal to DicriminatorColumn attribute), but I need Joined strategy to my TJoinedGlobal class.

Can you help me with this trouble?

Hi,


I didn't understand your message completely. Some parts I got, some parts are confusing. You must have a Table attribute defined for all classes in a joined tables inheritance, because each class will save its declared fields/properties in its own table. You must either have [Table] attribute defined, or [Automapping] attribute. 

Ok, I'll try to say more clear...


I have table Global. Mapping class - TGlobal.

One entity have some additional data - TChildOne = class (TGlobal) 

Yes, TChildOne must have a mapped table, so Aurelius know in which table it must save specific properties of TChildOne class.

Sorry for break.


One entity have some additional data - TChildOne = class (TGlobal) 

You can't save TChildTwo in same table as global, because you are using joined inheritance and each class must save the fields in a different table, that's the concept of joined-tables inheritance. You must save it in a different table.