Given the following JPA model:
@Entity
@Inheritance(strategy = javax.persistence.InheritanceType.JOINED)
public abstract class Buchung {
@Id
private Long id;
@ManyToOne
private Energiefluss energiefluss;
}
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
public abstract class Energiefluss {
@Id
private Long id;
@OneToMany(mappedBy = "energiefluss")
private List<Buchung> buchungen = new ArrayList<>();
}
@Entity
public class Erzeugungsanlage extends Energiefluss {
@OneToOne(mappedBy = "energiefluss")
private Portfoliowirkung portfoliowirkung;
}
@Entity
public class Portfoliowirkung extends Buchung {
}
The initialization of EntityManagerFactory fails with the following exception: org.hibernate.MappingException: property [energiefluss] not found on entity [frol.Portfoliowirkung]
The full stack trace is:
Eclipselink (version 2.5.2) does not throw any exception.
See the attached test case.
No exception is thrown, if
-
entity Buch has SINGLE_TABLE inheritance.
-
entity Energiefluss has SINGLE_TABLE inheritance.
-
entities Buch and Energiefluss both have SINGLE_TABLE inheritance.
|