Charith De Silva
Charith De Silva

Reputation: 3730

Multiple persistence files in spring

I'm trying to create multiple modules with multiple persistence xml files. Idea is to keep entity classes inside same module it belongs to.

Module 'A' configured with JPA with persistence.xml and working fine. Module 'B' has dependency with Module 'A' and has its own persistence.xml.

When I try to use I get

 IllegalStateException:Conflicting persistence unit definitions for name in

I'm building this test app with spring roo. Please shed a light on this. cheers

Upvotes: 0

Views: 3106

Answers (1)

jbbarquero
jbbarquero

Reputation: 2842

Review the persistance unit names in each persistence.xml

Something like persistanceUnit for the Module A (that works fine) and persistanceUnitB for Module B.

Besides, you'll have to asign the appropriate persistance unit to each Entity. You can use the corresponding attribute in the Roo annotation

Upvotes: 1

Related Questions