empulse-gmbh / eclipselink-static-weave-plugin

This repository contains a Maven plugin which does the static weaving for EclipseLink
17 stars 12 forks source link

EclipseLink: static weaving, inheritance and OSGi #4

Closed PavelTurk closed 1 year ago

PavelTurk commented 8 years ago

I use eclipselink 2.6.3. And I have two classes:

@Entity
class ClassA extends ClassB{...}

@MappedSuperclass
class ClassB{...}

And I do static weaving using maven-plugin:

       <plugin>
           <groupId>de.empulse.eclipselink</groupId>
           <artifactId>staticweave-maven-plugin</artifactId>
           <version>1.0.0</version>
           <executions>
               <execution>
                   <phase>process-classes</phase>
                   <goals>
                       <goal>weave</goal>
                   </goals>
                   <configuration>
                       <persistenceXMLLocation>META-INF/persistence.xml</persistenceXMLLocation>
                       <logLevel>ALL</logLevel>
                   </configuration>
               </execution>
           </executions>
           <dependencies>
               <dependency>
                   <groupId>org.eclipse.persistence</groupId>
                   <artifactId>org.eclipse.persistence.jpa</artifactId>
                   <version>${eclipselink.version}</version>
               </dependency>
           </dependencies>
       </plugin>

When ClassA and ClassB are in the same bundle weaving works. However, when they are in different bundles/project weaving doesn't work (although I added this plugin to both bundles/projects). How to fix this problem?

gjhut commented 5 years ago

It looks like this is not a problem with this plugin, but with the eclipselink static weaving itself. Starting with version 2.7.0 of eclipselink this should have been solved, if you look at this bugreport:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=466271

It could mean you would have to edit some properties in your persistence.xml file (see the bugreport for more info).