Skip to content

Issue with retrieval of polymorphic collections #7

@rko281

Description

@rko281

Reported by @daniels220:

Say I have a class hierarchy like:

SomeObject
    SomeObjectA
    SomeObjectB
OtherObjectA
OtherObjectB

SomeObject has a table definition, so it becomes the persistent root and SomeObjectA and SomeObjectB share a table.
OtherObjectA and OtherObjectB are both persistent but do not share a table.
SomeObjectA does define: #someReference as: OtherObjectA
SomeObjectB does define: #someReference as: OtherObjectB
Now, I retrieve a collection of SomeObjects which includes both SomeObjectAs and SomeObjectBs. I believe this would happen regardless of retrieval method, but I encountered it with an owned collection of SomeObjects. I expect the SomeObjectAs to have a proxy for an OtherObjectA, and the SomeObjectBs to have a proxy for an OtherObjectB, but in fact all of these proxies think they are for OtherObjectAs (or vice-versa—it's not clear to me what determines which class is used, but it is always the same, and therefore wrong for some objects/rows), leading to retrieving entirely the wrong object (or an SSWDBDeletedObject).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions