On 10-07-19 07:56 AM, Timothy Ward wrote:
Hi Jamie, I'm a little confused as to your requirements. It sounds as though you are trying to add new Entities (with relationships to existing entities) to an existing EntityManager at runtime. As the JPA service specification requires the managed classes to live in the same bundle as persistence.xml it is unlikely that you will be able to do this within the existing spec, and I'm not sure that "merging" EntityManagers will do anything to help either.
I reread the specification and I think you're right. I'll likely need to refactor the system to use a non-jpa approach, which is unfortunate. I think that OpenJPA is jpa-only so I may need to use hibernate (if it works in an osgi environment, I didn't have much luck last time I tried it), or at worst have the system implement the databases it supports by direct driver aggregation. I admit that it's a real surprise to me that jpa doesn't support a modular data approach, since polymorphism and dynamism is kind of at the root of object-oriented programming, and is much less useful if the associated data lacks the same dynamism...
-Jamie
