Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-2424

Classes are enhanced multiple times in a multi persistence-unit project

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.2.2
    • Fix Version/s: None
    • Component/s: Enhance
    • Labels:
      None
    • Environment:
      Windows 7
      JDK 1.7
      Maven 3.0.5

      Description

      We use the above environment to build our project. We use the openjpa-maven-plugin for the enhancement of the JPA classes. The persistence.xml configures 4 persistence-units for different database connections. Every persistence-unit defines own classes and uses the exclude-unlisted-classes Tag, because we only want every class to be enhanced only once.

      Now if we execute mvn install every defined class will be enhanced 4 times. The persistence.xml looks like this.

      <persistence xmlns="http://java.sun.com/xml/ns/persistence"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
      http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
      version="2.0">
      <persistence-unit name="db1">
      <class>ClassA</class>

      <exclude-unlisted-classes>true</exclude-unlisted-classes>

      <properties>
      ...some properties for the connection...
      </properties>
      </persistence-unit>

      <persistence-unit name="db2">
      <class>ClassB</class>

      <exclude-unlisted-classes>true</exclude-unlisted-classes>

      <properties>
      ...some properties for the connection...
      </properties>
      </persistence-unit>

      <persistence-unit name="db3">
      <class>ClassC</class>

      <exclude-unlisted-classes>true</exclude-unlisted-classes>

      <properties>
      ...some properties for the connection...
      </properties>
      </persistence-unit>

      <persistence-unit name="db4">
      <class>ClassD</class>

      <exclude-unlisted-classes>true</exclude-unlisted-classes>

      <properties>
      ...some properties for the connection...
      </properties>
      </persistence-unit>
      </persistence>

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              slaag Sebastian Laag
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: