[Closed] Mapped Superclass forces duplication of id field to make associations work on extended class

0 votes
asked Dec 31, 2014 in Solved by Mario (190 points)

Applies to ZF2/Doctrine 2 Annotations:

Reproduce:
- Create base class with primary key id field
- Create class extending from base class using Mapped Superclass type
- Try to create association in the extending class

Results:
The editor will not display any association fields because the primary key is defined and inherited from the base class. Now it would be required to re-create the the id field in the extended class, however cause "Duplicate definition of column 'id' on entity".

Expected:
Skipper should be able to see the inherited primary key field and allow it to be selected as an association key field.

Workaround:
Current workaround is to remove the id field from the base class, however it defeats the purpose.

commented Dec 31, 2014 by ludek.vodicka Skipper developer (140,450 points)

Thanks for posting. We're aware of this issue and we have a plans implement more sophisticated inheritancenm

commented May 9, 2016 by PaddyLock (310 points)

I also have this problem, my workaround is to add id to the inheriting class. Only the id on the mapped superclass is exported.

Please log in or register to answer this question.

...