I have a package (JAR_A) for entity and controller definition, for example:
Then I use this jar in other projects/applications that use the entity.
I want to use the same JAR_A with different persistence unit and different database (in particular, mysql and postgresql) but when I define two persistence unit that include the same class, I have an exception.
So, I comment the other PU and compile the project.
there is a smarter way for use same package with different PU ?
I'm sorry, I did not explain the situation in the right way.
I have at least 3 package:
- the first package (it's a maven project) contains a "superclass" entity
It defines the basic field of an entity and the relative getter and setter.
Inside the POM I define a plugin to enhance the class using datanucleus:
The plugin enhance the StandardEntity using the abstract persistence unit:
If the PU is like above, it works.
- the second package use the first and define software specific entity:
the pom is:
and the PUs are:
Even if I specified in the POM plugin only a PU, i get the following error:
An annotation processor threw an uncaught exception.
Consult the following stack trace for details.
java.lang.RuntimeException: javax.annotation.processing.FilerException: Attempt to recreate a file for type com.bss.easycooking.libdataeasycooking2.entity.BaseRicette_
Caused by: javax.annotation.processing.FilerException: Attempt to recreate a file for type com.bss.easycooking.libdataeasycooking2.entity.BaseRicette_