Dynamic Entities for EclipseLink
As EL misses the support for adding Entity-Classes programmatically, you can do the following:
Search your Classpath with the Reflections API (or Google Reflections API) for classes annotated with @Entity. Put these class-informations into your persistence.xml.
All other EL settings can be done programmatically via a properties map (new HashMap<String, Object>();) and a little help of PersistenceUnitProperties, which contains all available property-keys (never ever have a typo in your keys again :)
Written by Martin Röbert
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Eclipselink
Authors
maroe
1.341K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#