Invalid MappedBy parameter in ManyValuedAssociation

since 5.11 Aurelius supports Associations in Abstract Entities.

Now I got my first cross referenced Entities, raising an EInvalidMappedByReference.

TChild = class;
[Entity]
TParent = class
private
  [ManyValuedAssociation([TAssociationProp.Lazy], CascadeTypeAllRemoveOrphan, 'FParent']
  FChildren: Proxy<TList<TChild>>;
...

[AbstractEntity]
TAbstractChild = class abstract
private
  FParent: Proxy<TParent>;
...

[Entity]
TChild = class(TAbstractChild)
private
  {someotherfields}
...

If FParent is declared in TChild everything works as expected.

        Prop := FExplorer.EntityTypeFromClass(ForeignClass).Properties.Find(ManyVldAssoc.MappedBy);

        // Just test if the mapped member points to an instance of this class, otherwise the bidirectional mapping is wrong!
        if Prop = nil then
          raise EInvalidMappedByReference.Create(Clazz, RttiInfo.MemberName);

Prop will stay nil, because FParent is not part of TChild-EntityType.Properties...

looks like, this is little bit different to existing topic

Never mind, I forgot [AbstractEntity]...

1 Like

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