openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dennis Thrys√łe <>
Subject Re: Embedding OpenJPA
Date Wed, 16 May 2007 19:06:30 GMT
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 

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 

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?

The information in this email is confidential and may be legally protected.

View raw message