Take an abstract entity Vehicle with subtypes Car, Motorbike, and Truck (use any inheritance strategy you want, even SINGLE_TABLE)
How do you specify the attributes of the subtypes in a fetchGraph of Vehicle?
I tried with:
dataManager.load(Vehicle.class)
.condition(...)
.fetchPlanProperties(
"brand", // OK if defined on Vehicle
"fourWD", // FAILS if defined on Car
"maxTons", // FAILS if defined on Truck
)
.list();
but I get:
IllegalArgumentException: Property 'fourWD' not found in test_Vehicle
How do I specify something like this?
This would be trivial to do in either SQL or JPQL with just a LEFT JOIN.