Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Metamodel Generation(orm.xml inside persistence.xml is not relative to path)
Metamodel Generation [message #1849173] Thu, 06 January 2022 08:03
Hans Pikkemaat is currently offline Hans PikkemaatFriend
Messages: 9
Registered: January 2021
Junior Member
Hi,

I'm using the metamodel generator of eclipselink version 2.7.7 with maven. I only need to include the dependency to get it started:

        <dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>org.eclipse.persistence.jpa.modelgen.processor</artifactId>
            <version>2.7.7</version>
            <scope>provided</scope>
        </dependency>


I have two maven projects, a model project which only contains the classes which will act as entities and a maven project which contains a persistence.xml and an orm.xml and has a dependency to the first project so it can use the entity classes to store data.

The great thing about using orm.xml is that you can have one model and store them using two different persistence.xml/orm.xml files in different databases. This is useful e.g. if you want to migrate to a new storage format.

The problem I'm having now is that when I use the following plugin in the service project

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.7.0</version>
                <configuration>
                    <compilerArgs>
                        <arg>-Aeclipselink.persistencexml=${project.basedir}/../mode/src/main/resources/META-INF/persistence.xml</arg>
                    </compilerArgs>
                </configuration>
            </plugin>
        </plugins>


Then it does not find the orm.xml. This is a part of the persistence.xml

    <persistence-unit name="my-pu">
        <jta-data-source>jdbc/db</jta-data-source>
        <mapping-file>META-INF/orm.xml</mapping-file>


I was hoping that the model generator would try to load the orm.xml relative to the path where the persistence.xml is loaded but it is not.

I checked the docs and could not find a setting to help me with this.

So my question is: is there a way to tell the metamodel generator to load the orm.xml relative to the path of the persistence.xml?

best regards,

Hans
Previous Topic:Extending tables looks up in wrong schema / catalog
Next Topic:Problems migrating from eclipselink 2.7.8 to 2.7.9
Goto Forum:
  


Current Time: Fri Apr 26 23:42:01 GMT 2024

Powered by FUDForum. Page generated in 0.02917 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top