Beginner |
|
Joined: Wed Nov 21, 2007 10:24 am Posts: 25
|
I'm trying to create a criteria query on a class that has several different subclasses that have foreign keys to other classes.
Value Subclass Table1Value extends Value => Table1 Subclass Table2Value extends Value => Table2
So I have Value which is referenced by some class and I want to be able to get to Table1 by way of subclass Table1Value, but all I'm able to join is anything ? super Value. I want to get down to its subclasses and join off that. How can I do that using the JPA criteria api? I can do it through JPQL using value.table1Value and also doing a TYPE(value) IN (Table1Value) to make sure it's only going to do that type. However, I can't see a way to do this through the JPA criteria api which is my preferred way to do it since I can use the generated metamodel classes to make it typesafe.
|
|