<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
		http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd">

      <context:annotation-config />
      <bean id="dataSource"
	class="org.springframework.jdbc.datasource.DriverManagerDataSource">
	<property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
	<property name="url" value="jdbc:mysql://localhost:3306/eCommerce"></property>
	<property name="username" value="root"></property>
	<property name="password" value="231980"></property>
      </bean>

      <bean id="persistenceUnitManager"
	class="org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager">
	<property name="defaultDataSource" ref="dataSource" />

	<property name="persistenceXmlLocations">
	      <list>
		<value>classpath*:META-INF/persistence.xml</value>
	      </list>
	</property>

      </bean>
      <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
	<property name="persistenceUnitManager" ref="persistenceUnitManager"/>
	<property name="persistenceUnitName" value="eCommerce"/>
      </bean>

      <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
	<property name="entityManagerFactory" ref="entityManagerFactory"/>
      </bean>
      <tx:annotation-driven transaction-manager="transactionManager"/>
      <context:annotation-config></context:annotation-config>
</beans>