2013-06-27 2 views

ответ

2

Там нет включать синтаксис orm.xml, но вы можете указать несколько <mapping-file> в persistence.xml.

1

Да, в META-INF добавить orm1.xml, orm2.xml.

<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"> 
    <persistence-unit name="UnitPU" transaction-type="RESOURCE_LOCAL"> 
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider> 
    <class>co.com.prueba.modelo.Person</class>  
    <properties> 
     <property name="javax.persistence.jdbc.url" value="jdbc:oracle:thin:@localhost:1521:xe"/> 
     <property name="javax.persistence.jdbc.user" value="user"/> 
     <property name="javax.persistence.jdbc.driver" value="oracle.jdbc.OracleDriver"/> 
     <property name="javax.persistence.jdbc.password" value="1234"/> 
    </properties> 
    <mapping-file>META-INF/orm1.xml</mapping-file> 
    <mapping-file>META-INF/orm1.xml</mapping-file> 
    </persistence-unit>