I have the same problem and I did not find a solution in the Criteria API. Looking at the source of the CriteriaBuilderImpl class, all “treat” methods for “Join” object go through a common method that add the “treat” object to the “Joins” set of the parent of the “Join” object :
But the fetchs objects are stored in another set. So I do a similar processing for my fetch that need downcasting and that works !!!
I hope this can help… |