Patrick Linskey wrote:
This means that your container would be responsible for EntityManager
lifecycle and potentially for transaction control. It also means that
you'd interact with OpenJPA via the
PersistenceProvider.createContainerEntityManagerFactory() API. In such
a scenario, you (the container) would be responsible for providing a
PersistenceUnitInfo (you might want to take advantage of OpenJPA's
existing XML-processing support to help out with this).
That sounds like the right way to do it. So my container would, on
startup, instantiate OpenJPA's PersistenceProviderImpl, and invoke
createContainerEntityManagerFactory() with a PersistenceUnitInfo that I
implement?
I can see that this gives me a great deal of control over classloading,
transactions, etc. But it looks like I still need to supply all managed
class names up front, and must refer to mapping information as file
references?
I am hoping for a way to enhance and register classes as appropriate at
ordinary classloading time, or if that isn't possible at least discover
the classes dynamically at deployment time. Generally I'm trying to
avoid using persistence.xml.
Likewise the mapping information should only come from annotations on
the managed classes, but ideally through me such that certain things
can be changed on the fly (such as field value and type conversion etc.)
Is this possible? Perhaps by providing certain properties in the map
when obtaining an EntityManagerFactory? Or am I being too creative here?
-dennis
---
The information in this email is confidential and may be legally protected.