Announcement Announcement Module
Collapse
No announcement yet.
using @Profile (or something similar) to dynamically register Entity beans Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • using @Profile (or something similar) to dynamically register Entity beans

    Scenario

    I have an application that has something like this

    @Entity CoreThing

    and some customer specific versions

    @Entity CustomerAThing extends CoreThing

    @Entity CustomerBThing extends CoreThing

    @Entity CustomerBOtherThing

    Is there any way I can use something like profiles to only register CustomerB's entites when the entity manager gets created, e.g. a profile aware package scanner or something ?


  • #2
    I have not tried this myself but have you looked at using different persistence units? so you could then have multiple EntityManagerFactory Beans with different profiles that have different packagesToScan (so you would need to separate the customer objects into different packages) or different persistenceUnitName.

    Comment

    Working...
    X