I have an abstract class:
@Entity @Inheritance(strategy = InheritanceType.JOINED) public abstract class A { ... }
and several extension classes, for example:
@Entity public class B extends A { ... }
I also have a third object:
@Entity public class C { @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER) private A objectA; ... }
And the question is, how can I build a Spring Data JPA finder in the C object repository to query only objects that extend A with the desired type?
java spring-data spring-data-jpa jpa
Jakub kubrynski
source share