JPA 2.0: Adding entity classes to PersistenceUnit *from different jar* automatically

前端 未结 8 561
余生分开走
余生分开走 2020-11-29 02:23

I have a maven-built CDI-based Java SE app, which has a core module, and other modules.
Core has the persistence.xml and some entities. Modules hav

8条回答
  •  無奈伤痛
    2020-11-29 03:05

    Possible duplicate, see my SO question.

    We faced the same problem and the only way we found was to accumulate all entities in one persistence.xml for the final (web-)application.

    At the same time we define separate persistence.xml files in our test resources so we can run acceptance tests per module.

提交回复
热议问题