<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"
p:database="MYSQL" p:databasePlatform="org.hibernate.dialect.MySQL5Dialect"
p:showSql="true" />
</property>
<property name="persistenceXmlLocation" value="classpath*:META-INF/persistence.xml" />
<property name="persistenceUnitName" value="streamJpaDB" />
</bean>
持久单位
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" 版本=&#34; 1.0&#34;&GT;
<persistence-unit name="streamJpaDB" transaction-type="RESOURCE_LOCAL">
<non-jta-data-source>jdbc.streamDataSource</non-jta-data-source>
<properties>
<property name="hibernate.show-sql" value="true" />
</properties>
</persistence-unit>
答案 0 :(得分:0)
<ResourceLink name="jdbc/streamDataSource"
global="jdbc/streamDataSource"
type="javax.sql.DataSource"/>
to con / context.xml