My DB structure is as follows:
work:
- CTI table Work
- MappedSuperclass table AbstractImageWork which extends Work
- final table PhotoWork which extends AbstractImageWork
comment:
WorkComment has a ManyToOne relation to Work:
@ManyToOne(targetEntity="Work", inversedBy="comments")
Work has a OneToMany relation to WorkComment:
@OneToMany(targetEntity="WorkComment", mappedBy="work")
The problem is that Doctrine gives me this error while updating the schema:
[DoctrineORMMappingMappingException]
It is illegal to put an inverse side one-to-many or many-to-many association on
mapped superclass 'Acme...AbstractImageWork#comments'.
I guess this has something to do with the MappedSuperclass AbstractImageWork stuck in the middle between Work and PhotoWork, but I didn't actually put this relation on the MappedSuperclass, but on the CTI table.. so why will Doctrine behave like this?
Any ideas?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…