Programming <class> Definitions in EclipseLink
I am trying to use EclipseLink in an OSGi environment.
What I want to do is create a provider package that exposes the EntityManager to other bindings.
The problem is that entity classes cannot be defined and written to the persistence.xml file at compile time. So I want to be able to define entity classes programmatically. I can scan all the Entity classes, but as far as I could see there is no way to define it in EclipseLink, while it is possible in Hibernate. (Hibernate has some other issues in the OSGi environment, so I cannot use it).
How can I define classes of objects programmatically?
Note. Using spring is not an option for me; and defining ClassDescriptors from scratch is not allowed. I have to say that it is really silly that such an essential feature is not supported directly in JPA or EclipseLink.
source to share