I want to create a modular(plugin-like) application that uses JPA as its persistence abstraction, and this application should be extensible by third parties.
The catch is that I want this application and its plugins to be easily portable to other databases/JPA providers, so the third party vendors can't know anything about the used JPA provider(or databases connections), they can only extend the persistence layer by defining new entities to be stored in the main app persistence unit(this would allow one to switch databases without having to reconfigure every module to point to the new db).
Can I do something like that with JPA? I can do it easily with .NET's nHibernate(and probably with Hibernate) but I prefer to program against JPA since I'm in a Java EE environment.