Recursive JPA query?
问题 Does JPA 2 have any mechanism for running recursive queries? Here's my situation: I have an entity E, which contains an integer field x. It also may have children of type E, mapped via @OneToMany. What I'd like to do is find an E by primary key, and get its value of x, along with the x values of all its descendants. Is there any way to do this in a single query? I'm using Hibernate 3.5.3, but I'd prefer not to have any explicit dependencies on Hibernate APIs. EDIT: According to this item,