I've abstract class:
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
public abstract class A {
...
}
and few extending classes, like:
@Entity
public class B extends A {
...
}
I also have third entity:
@Entity
public class C {
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
private A objectA;
...
}
And the question is, how can I construct Spring Data JPA finder in C entity repository to query only objects extending A with desired type?
select s from Sample s where TYPE(s) = :type- MariuszS