Dictionary with inheritance / joined tables

I'm trying to star using the new dictionary.
I have two tables that use inheritance, with [Inheritance(TInheritanceStrategy.JoinedTables)] defined in the parent class, and [PrimaryJoinColumn('MyEntityID')] in the child class.
The dictionary does not expose the MyEntityID when I reference this child class.

Is it by design? How could I use the dictionary in these cases?
Will next versions be exposing the primary join column in child classes dictionary interfaces?

btw.. my classes and dictionary are generated from Data Modeler.

The dictionary is about object fields and properties. The database columns are never intended to be "known" by Aurelius users, it's internal information. The primary join columns are not supposed to be used in Aurelius queries, regardless if you are using the dictionary or not.

I don't understand the answer. The ID is a field. and also a property. I'm not using Linq.SQL.

I have an entity "Pessoa" and an inherited entity "PessoaFisica".

  [Entity]
  [Table('pessoas')]
  [Description('')]
  [Inheritance(TInheritanceStrategy.JoinedTables)]
  [Id('FIDPessoa', TIdGenerator.SmartGuid)]
  TPessoa = class(TInterfacedPersistent)
  private
    [Column('id_pessoa', [TColumnProp.Required], 38)]
    [Description('')]
    FIDPessoa: string;

...

  [Entity]
  [Table('ger_pessoasfisicas')]
  [Description('')]
  [PrimaryJoinColumn('id_pessoa')]
  TPessoaFisica = class(TPessoa)

So I'll never be able to query TPessoaFisica by it's IDPessoa field which was inherited from TPessoa using the dictionary?

For example, in some point of the code, I had:

    adsRegMed.SetSourceCriteria(
      mgr.Find<TSaudeRegistro>
        .CreateAlias('PessoaFisica', 'pf')
        .Where(Linq.Eq('pf.idpessoa', sIDPessoaAtual))
    );
    adsRegMed.Open;

I could not change it to use the new dictionary, as PessoaFisica.IDPessoa is not exposed.

Ok ... now I see I quite haven't expressed it very well when I talked about "column". I've been really looking for "the inherited field that holds my entity's ID".
Now I see my doubt is really not specific on ID fields, or the inheritance strategy ... but how to deal and filter queries with dictionary & inheritance as no inherited fields are exposed (always talking about Data Modeler dictionary generator).

I understand what you mean now. Indeed, this is currently not supported, we will look into improving it for a future release.

Hi there!
Just to "up" this issue again... about Dictionary child interfaces not exposing parent class properties when inheritance is used.
Thanks.

TMS Data Modeler 3.13 has been released with a fix for this issue.

2 Likes

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.