当前位置: 网站首页 > JAVA > j2ee

在Spring环境中建立JPA

时间:1970-1-1 08:33:31来源: j2ee作者:admin 点击:29次 字体 [ С]

    <entry key="remoteDataSource" value-ref="remote-db"/>
   </map>
</property>
<!-- if no datasource is specified, use this one -->
<property name="defaultDataSource" ref="remoteDataSource"/>
</bean>

<bean id="emf" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="persistenceUnitManager" ref="pum"/>
</bean>
要注意的是,缺省实现允许在将持久化单元信息传入JPA provider之前用 PersistenceUnitPostProcessor(它允许选择持久化单元)修改它们,传入的过程可以是通过属性声明式地传入(影响其中所有的单元)或编程式地传入。如果没有指定persistenceUnitManager,LocalContainerEntityManagerFactoryBean 会创建一个并在内部使用它。


发表评论
验证码:
最新评论
相关文章
最热文章