Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-dev] Dynamic persistence unit

All -

For a while now, I have wanted an easier way to test EclipseLink and tonight I finally found a few spare cycles to look at this problem. I have been looking for a way to easily create a persistence unit that only exists for the scope of an individual test. I did some poking around and found that without too many changes, I could update JPAInitializer so that a user to could create a SEPersistenceUnitInfo and pass that in as a persistence property on a .createEntityManagerFactory(....) call. This means that you could create an EMF without the requirement of having a p.xml file... the largest drawback I can see at this point is that this data structure is marked as internal, so I don't know if it is kosher to expose outside of the runtime.

Thoughts on going down this road? If I don't hear anything negative, I'll get a bug opened soon and post an initial patch.

--
Rick Curtis

Back to the top