Suppose we have
@Entity
public class A {
@Id
private long id;
@ManyToOne
private A parent;
... getters and setters
public List<A> path() {
List<A> path;
if (parent != null) {
path = parent.path();
} else {
path = new ArrayList<A>();
}
path.add(this);
}
}
Is it possible to get the list returned by the path method using a EJB query?
Thanks