0

Given a single db schema and two (or more) bundles.

Question: is it possible to have JPA entities (for the single schema) distributed across bundles?

(I was initially thinking about fragment bundles, but want to know if there are other possibilities)

mhshams
  • 16,384
  • 17
  • 55
  • 65

1 Answers1

0

If all of your entity classes are listed in persistence.xml, then it is possible.

Be sure that the classloader that the JPA engine uses, sees all of the Entity classes and the classes of the JPA engine, too! It depends on the tools you use, how to solve this. E.g.: Some of the extenders use the classloader of the bundle that contains the persistence.xml file mixed with the classloader of the JPA engine. In this case, you must import all of the packages that are used in persistence.xml by the bundle, that contains persistence.xml.

Balazs Zsoldos
  • 6,036
  • 2
  • 23
  • 31