Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
4.2.RC1
-
None
-
None
Description
For an entity inheritance hierarchy, fetching on superclass should allow prefetches on subclasses. Semantically they can be resolved as DbRelationships, and the results can be applied only to the right subclasses.
E.g. in our unit tests (where somewhat weirdly, User inherits from Role), the following code throws, while it should succeed (see attached patch with a full test) :
ObjectSelect.query(Role.class) .prefetch(User.USER_PROPERTIES.joint()) .select(context)
This would allow to properly deep-refresh objects across the inheritance hierarchy.
I suspect that we may eventually decide to similarly support orderings and qualifiers based on subclass attributes (so any common SQL translator algorithms should be generalized across use cases). But prefetching seems like the most useful initial case.