EclipseLink相当于openjpa.properties?

时间:2014-07-30 02:20:20

标签: spring jpa eclipselink

EclipseLink是否具有与openjpa.properties等效的东西,让我指定persistence.xml的位置?

调整类路径以查找persistence.xml是EclipseLink的唯一选项吗?

FWIW这是一个Spring 4.应用程序

TIA。

1 个答案:

答案 0 :(得分:1)

基于Spring的应用程序的答案是

    <tx:annotation-driven mode="aspectj" transaction-manager="transactionManager" />
    <bean class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" id="entityManagerFactory">
            <property name="persistenceUnitName" value="persistenceUnit" />
            <property name="persistenceXmlLocation" value="file:<Path to your persistence.xml>" />
            <property name="dataSource" ref="dataSource" />
    </bean>