Search code examples
jpaormjpa-2.0eclipselinktoplink

@MappedSuperclass static weaving with EclipseLink and multiple jars


My entities objects are scattered in multiple jars.
In jar A I have a base class name MyBase which is annotated with @MappedSuperclass.
In jar B there is an entity class which derives from MyBase.
The problem is that because the weaving is done in the context of the jar file (I'm using the maven plugin) the base class (MyBase) isn't instrumented (although it should).
If I move the derived class from jar B to A then the weaving process will handle the base as well.
Since I'm working on a large project it is critical for me to develop in a modular way.
Doesn't EclipseLink support such methodology?


Solution

  • The only way I found to override this limitation is to add a temporary entity class to the jar where the @MappedSuperclass base class is defined and remove it after the weaving procedure.
    Sad, but true ;-)