|
|
|
|
|
|
This is meant to cover both implicit and explicit cases of downcasting. FWIW JPA only defines support for explicit downcasting; implicit downcasting is a HQL-only feature (check for strict jpql compliance).
This needs to keep more than "just" downcast target; we also need to track where the downcast occurred as that later affects the SQL that needs to be generated (includeSubclasses).
One option, rather that wrapping, is to register the "treated FromElement" into the alias registry under its implicit/explicit alias (for use in expressions) but to not render it into the tree.
Another option is to piggy-back on Hibernate's notion of implicit downcasting in terms of expressions originating from the treated FromElement. So we'd still register the "treat target" with the FromElement, but just ignore it in expressions using the treated FromElement. This has a big drawback in terms of TREATs that occur in predicates.
Anyway, still a lot to think through...
|
|
|
|
|
|