Access Field generated by Many-Value Association

Because of my Multi-Model Design:

There is an Entity referenced by another Entity using many valued association.

[Entity]
[Model('TenantDb'), Model('Dummy')]
[Inheritance(TInheritanceStrategy.SingleTable)]
[DiscriminatorColumn(csFldKind, TDiscriminatorType.dtString)]
TEntity = class
...
end;

[Entity]
[Model('TenantDb')]
[DiscriminatorValue('Child']
TEntityChild = class(TEntity)
private
  // some fields
  // FAnotherEntityInDummy: Proxy<TAnotherDummyEntity>; // not existing Proxy single value assoc
...
end;

This is because TAnotherDummyEntity is not required in my dummy model.

[Entity]
[Model('TenantDb')]
TAnotherDummyEntity = class(TEntity)
private
  // some fields
   FChildEntity: Proxy<TList<TEntityChild>>; // generating another_dummy_entity_id on TEntityChild
...
end;

is it possible to access another_dummy_entity_id without using sql-expressions?

nevermind...

ObjectManager.Find<TAnotherDummyEntity>.Where(Dic.AnotherDummyEntity.ChildEntity.Id = Id).UniqueResult;

works realy fine, out of TEntityChild, storing TAnotherDummyEntity in a transient field.

1 Like

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