This is not supported. According to JPA 2.1, section 2.2, "Persistent Fields and Properties": "Entity subclasses may override the property accessor methods. However, portable applications must not override the object/relational mapping metadata that applies to the persistent fields or properties of entity superclasses". The test case overrides the metadata on E#getTarget ( with @ManyToOne(targetEntity=D.class). |