큰 EJB3 프로젝트에서 작업하고 orm.xml도 매우 큽니다. 다른 orm 파일을 orm "상위"에 포함 할 수 있습니까? 도움을EJB3 : orm.xml : 여러 개의 orm.xml 파일을 가질 수 있습니까?
감사합니다 :)
큰 EJB3 프로젝트에서 작업하고 orm.xml도 매우 큽니다. 다른 orm 파일을 orm "상위"에 포함 할 수 있습니까? 도움을EJB3 : orm.xml : 여러 개의 orm.xml 파일을 가질 수 있습니까?
감사합니다 :)
이 더는 orm.xml에 대한 구문을 포함 없습니다,하지만 당신은이 persistence.xml에서 여러 <mapping-file>
을 지정할 수 있습니다.
예, 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>