[
https://issues.apache.org/jira/browse/OPENJPA-2766?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16736049#comment-16736049
]
Romain Manni-Bucau commented on OPENJPA-2766:
---------------------------------------------
Hi matt,
what is missing since jar-file is handled?
Side note: I added persistence-fragment.xml to TomEE and it never had been used
so I'm not super motivated to add it in OpenJPA too.
About classpath scanning: this is already built-in
(https://github.com/apache/openjpa/blob/08bb3a5a0e7573622aa6dc25763cb6513095093b/openjpa-kernel/src/main/java/org/apache/openjpa/meta/AbstractCFMetaDataFactory.java#L627)
About manual registration/unregistration: you can create multiple EM and hide
them behind a facade (whiteboard) in OSGi, this is more reliable than
adding/removing entities in the unit which can break the app quite easily IMHO.
Do you have some concrete example we can base the reflection upon?
> Modularity support
> ------------------
>
> Key: OPENJPA-2766
> URL: https://issues.apache.org/jira/browse/OPENJPA-2766
> Project: OpenJPA
> Issue Type: New Feature
> Reporter: Matt Pavlovich
> Priority: Major
>
> Support modular organization of entities so that all entities do not need to
> be contained in the same jar, or referenced in a single persistence.xml
> <class> listing.
> Use cases:
> 1. Jar A contains entityA, Jar B contains entityB. (EntityB may or may not
> extend from entityA.)
> 2. Jar X contains persistence.xml defining the PU
> 3. Jar C contains entityC and a list of classes that extend entityA. Jar X
> persistence unit should be able to persist entityC and its collection of
> entityA, entityB.. etc
> Features:
> 1. Auto-classpath scanning (perhaps for persistence-fragment.xml.. then
> enumerate)
> 2. Support manual registration and unregistration of entity classes (not just
> class names) to support OSGi environments that have per-bundle classloaders
> and deploy/undeploy support.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)