I'm writing a library that will be used to Hibernate many types of EJBs via JPA. When loading an EJB from JPA, the library needs the datatype of the field(s) annotated with @Id. The @Id may be annotated on a superclass of the EJB. Is there a method in Hibernate or JPA that can get the datatype of @Id?
I'm tempted to use reflection, but this would require recursion and code that probably already exists in JPA.