0

I see that this question has been asked before, but I haven't seen any answered in a number of years. The answers from previous years which I was able to find were not adequate.

Is there a way to load/set/define entity classes for a persistence unit at runtime either in addition to, or instead of defining them in the persistence.xml file?

I'm using Guice as my framework, so if there is an answer specific to Guice, all the better. I'm not interested in any solutions involving Spring unless they could be used outside of the Spring framework.

Baba
  • 79
  • 1
  • 12
  • post what is in your `persistence.xml` as a start. In particular is there `exclude-unlisted-classes` ? –  Oct 08 '17 at 17:37
  • There is no persistence file at this time. I haven't built any of it yet. There may be some in the persistence.xml file, but additional plug-in modules may have need of having entities registered, so I am looking to do it dynamically at runtime. As for the exclude-unlisted-classes property, I prefer not to add classes in bulk, but rather assign the specific classes to include. – Baba Oct 08 '17 at 18:07

0 Answers0