| Can we stop with these inane “well JPA provider X” does it? I can’t think of any other argument that makes me want to do something less. Either you are claiming Hibernate violates the spec or simply trying some kowtow technique to force to do something I guess? Considering Hibernate passes all JPA TCK tests, hard to be #1. That said… I am not able to reproduce this. I took this psuedo-model and was able to use it just fine:
@Entity( name = "Person" )
@Table( name = "persons" )
public static class Person {
@Id
private Integer id;
private String name;
@OneToMany( cascade = CascadeType.ALL, mappedBy = "owner" )
private List<Cat> cats = new ArrayList<>();
}
@Entity( name = "Mammal" )
@Table( name = "mammals" )
@Inheritance( strategy = InheritanceType.JOINED )
public static class Mammal {
@Id
private Integer id;
private String name;
@ManyToOne
@JoinColumn( unique = true )
private Person owner;
}
@Entity( name = "Cat" )
@Table( name = "cats" )
public static class Cat extends Mammal {
private boolean polydactyl;
}
@Entity( name = "Dog" )
@Table( name = "dogs" )
public static class Dog extends Mammal {
private boolean akcRecognized;
}
So going to need a reproducer. I looked at this because Christian Beikov asked me to. Please open a new issue with a test that actually reproduces this and link it here |