Skip to content

Invalid Bidirectional Association Mapping with Mapped Superclass in Class Hierarchy #9516

@bobdercole

Description

@bobdercole

Bug Report

Q A
BC Break no
Version 2.11.1

Summary

I receive a mapping exception after defining an inverse-side association on an abstract entity. A mapped superclass extends the abstract entity. A concrete entity extends the mapped superclass.

Current behavior

ClassMetadataFactory is currently throwing an exception if there is an inverse-side association on a mapped superclass.

if ($mapping['type'] & ClassMetadata::TO_MANY && ! $mapping['isOwningSide']) {

This is correct, as stated in the documentation. However, I believe this limitation should be imposed only if the association is on the mapped superclass itself.

How to reproduce

  • Define an abstract entity (A).
  • Define a mapped superclass (B) extends A.
  • Define a concrete entity (C) extends B.
  • Define another entity (D) that has a many-to-one relationship with A.

I will follow-up with a failing test case.

Expected behavior

I think the above mapping should be valid since the association is not defined directly on the mapped superclass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions