openjpa multiple persistence units

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

openjpa multiple persistence units

Matthew Broadhead-2
eclipse IDE is complaining if i have multiple persistence units and they
contain classes with the same name.  e.g.
<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">
         <jta-data-source>db1</jta-data-source>
<non-jta-data-source>db1Unmanaged</non-jta-data-source>
         <class>com.test.entities.jpa.db1.Test</class>
         <properties>
             <property name="openjpa.jdbc.SynchronizeMappings"
                 value="buildSchema(ForeignKeys=true)" />
         </properties>
     </persistence-unit>
     <persistence-unit name="db2">
         <jta-data-source>db2</jta-data-source>
<non-jta-data-source>db2Unmanaged</non-jta-data-source>
         <class>com.test.entities.jpa.db2.Test</class>
         <properties>
             <property name="openjpa.jdbc.SynchronizeMappings"
                 value="buildSchema(ForeignKeys=true)" />
         </properties>
     </persistence-unit>
</persistence>
is eclipse right or can i ignore the error?
Reply | Threaded
Open this post in threaded view
|

Re: openjpa multiple persistence units

Matthew Broadhead-2
i found it
<exclude-unlisted-classes>true</exclude-unlisted-classes>

On 22/10/2018 19:14, Matthew Broadhead wrote:

> eclipse IDE is complaining if i have multiple persistence units and
> they contain classes with the same name.  e.g.
> <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">
>         <jta-data-source>db1</jta-data-source>
> <non-jta-data-source>db1Unmanaged</non-jta-data-source>
>         <class>com.test.entities.jpa.db1.Test</class>
>         <properties>
>             <property name="openjpa.jdbc.SynchronizeMappings"
>                 value="buildSchema(ForeignKeys=true)" />
>         </properties>
>     </persistence-unit>
>     <persistence-unit name="db2">
>         <jta-data-source>db2</jta-data-source>
> <non-jta-data-source>db2Unmanaged</non-jta-data-source>
>         <class>com.test.entities.jpa.db2.Test</class>
>         <properties>
>             <property name="openjpa.jdbc.SynchronizeMappings"
>                 value="buildSchema(ForeignKeys=true)" />
>         </properties>
>     </persistence-unit>
> </persistence>
> is eclipse right or can i ignore the error?