From the question How do you find all subclasses of a given class in Java?, this answer might be helpful:
Using the class PojoClassImpl.java you can get the super class by calling method getSuperClass(). I think that is sufficient for you to write a recursive method.