I'm using Spring, Hibernate and the JPA Criteria API.
Let's say I have a Vehicle class hierarchy and a Tire class. Each Vehicle can have multiple Tires.
Vehicle -- Tanker, Motorcylce
Tire
I want to query for small tires that are on Tankers with a capacity over 100 gallons. But the vehicle property for Tire is of type Vehicle. Only one of the Vehicle subclasses (Tanker) has the "capacity" property. How do I tell the criteria api to join ONLY on Tankers?
Thanks!
I'm sure this is has been asked/answered before, but I think I'm missing the right terminology to have a successful search.