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_
at org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor.process(CanonicalModelProcessor.java:407)
...
Caused by: javax.annotation.processing.FilerException: Attempt to recreate a file for type com.bss.easycooking.libdataeasycooking2.entity.BaseRicette_
at com.sun.tools.javac.processing.JavacFiler.checkNameAndExistence(JavacFiler.java:522)
i found this page:
https://netbeans.org/bugzilla/show_bug.cgi?id=194605
The problem is that the same entity can't stay in two PU...the class first is enhanced for PU1 and then for PU2 but files already exists.
So, is a possible solution to create two plugin, one for PU, and create two JAR, *-mysql.jar and *postgresql.jar ?