This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi. I am currently learning EJB3, and time has come to get the hang of JPQL. I have two persistence units, one uses TopLink Essentials (default for GlassFish, the application server I am using), and the other one is Hibernate EntityManager. I hava a Category class, that has a one-to-many mapping to itself. That is, a Category has a parent, and a category has many subcategories. With Hibernate, it is possible to "recursively" fetch parents. For example, Category A has a Subcategory B, which has Subcategory C. This query returns the whole hierarchy starting with C, going upward:
I can also use
which TopLink refuses to process even for one fetch join, as there is an alias specified for the fetch property. So my question is, can this be done in Toplink? Or is it one limitation of JPA altogether, to allow only one level of fetch joins? Thanks.