I have the following object graph and I am having an issue getting a Named to work properly.
class A {
Set<B> bs;
}
class B {
Set<C> cs;
}
@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "type", discriminatorType = DiscriminatorType.STRING)
class C {
Integer id;
String type;
}
@Entity
@DiscriminatorValue("D")
class D extends C {
String name;
}
I need a query to give me all of the A's where D.name = some value. Here are a couple of attempts I made with no luck.
1. Select a From A as a, D as d Where a.bs.cs.id = d.id and d.name = ?
2. Select a From A as a Where a.bs.cs.name = ?
|