Can I inherit an entity without using an entity attribute?

Hello!

The way our DB is designed is we have a table CMTOGETTI (=objects) and several detail tables.
Alas, some objects do not have a special table, so what happens is we retrieve certain details dynamically via joins.

What I want to do is inherit a new class, from the base class, without adding persistence attributes because I want to use the ones in the inherited class.
Can I do that seamlessly in Aurelius? If not, what is my best option?

Thanks!

Hey!

In the meantime, I have tried to make this work in.. a rather interesting way.
What I have done is replicate the attributes in TCMTOGGETTI into the new class, like so:

unit Common.BFive.DerivedModel;

interface

uses
  Aurelius.Mapping.Attributes, Aurelius.Types.Nullable,
  Common.BFive.Model;

Type
  [Entity]
  [Table('CMTOGGETTI')]
  [UniqueKey('CODICE, ID_CMTTIPIOGGETTO, DATA_INIZIO, DATA_FINE, ID_PADRE')]
  TDerivedDotazioneSito = class( TCMTOGGETTI )
  strict private
    [Association([TAssociationProp.Required], CascadeTypeAll - [TCascadeType.Remove])]
    [JoinColumn('ID_ROOT', [], 'ID_CMTOGGETTI')]
    FID_CMTSITI: Nullable<TCMTSITI>;
  public
    property ID_CMTSITI: Nullable<TCMTSITI> read FID_CMTSITI write FID_CMTSITI;
  end;

implementation

end.

After removing the lazy references and the required column, I still get this error when I try a simple list:

ThreadId=10060
ProcessId=3
ThreadName="Main Thread"
ExceptionMessage="Field/property is not a Proxy<T> type (C:\Users\Administrator\Documents\tmssoftware\business11\aurelius\source\core\Aurelius.Mapping.Explorer.pas, line 3332)"
ExceptionName="EAssertionFailed"
ExceptionDisplayName="EAssertionFailed"
ExceptionAddress=75345432
FileName=<not available>
LineNumber=<not available>
ExceptionObject=05E49D20
Classes=[EAssertionFailed,Exception,TObject]

but there is no proxy in there.
Suggestions?

Thanks!

You didn't provide the mapping (source code) for class TCMTOGGETTI so I can't be 100% sure about what's going on. I can say in advance that if TCMTOGGETTI is mapped with Entity attribute, you can't inherit another entity from it, unless you use one of the available inheritance strategies.

The error indicates that you have created an Association attribute with Lazy flag, but the field is not a proxy (and it should). Either configure it as a proxy, or remove the Lazy flag from the association.