1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3.     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
  4.     xmlns:tx="http://www.springframework.org/schema/tx" xmlns:p="http://www.springframework.org/schema/p"
  5.     xmlns:aop="http://www.springframework.org/schema/aop"
  6.     xsi:schemaLocation="http://www.springframework.org/schema/beans  http://www.springframework.org/schema/beans/spring-beans-3.0.xsd  http://www.springframework.org/schema/context  http://www.springframework.org/schema/context/spring-context-3.0.xsd  http://www.springframework.org/schema/tx  http://www.springframework.org/schema/tx/spring-tx-3.0.xsd  http://www.springframework.org/schema/aop  http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
  7.  
  8.     <!-- holding properties for database connectivity / -->
  9.     <context:property-placeholder location="classpath:jdbc.properties" />
  10.     <!-- enabling annotation driven configuration / -->
  11.     <context:annotation-config />
  12.     <context:component-scan base-package="aop.web.teacher.dao" />
  13.     <tx:annotation-driven transaction-manager="transactionManager" />
  14.    
  15.  
  16.     <bean
  17.         class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />
  18.  
  19.  
  20.     <bean id="dataSource"
  21.         class="org.springframework.jdbc.datasource.DriverManagerDataSource"
  22.         p:driverClassName="${jdbc.driverClassName}" p:url="${jdbc.url}"
  23.         p:username="${jdbc.username}" p:password="${jdbc.password}" />
  24.  
  25.     <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"
  26.         p:entityManagerFactory-ref="entityManagerFactory" />
  27.  
  28.     <bean id="entityManagerFactory"
  29.         class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
  30.         p:dataSource-ref="dataSource" p:jpaVendorAdapter-ref="jpaAdapter">
  31.         <property name="loadTimeWeaver">
  32.             <bean
  33.                 class="org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver" />
  34.         </property>
  35.         <property name="persistenceUnitName" value="wctemplatePU"></property>
  36.     </bean>
  37.  
  38.     <bean id="jpaAdapter"
  39.         class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"
  40.         p:showSql="${jpa.showSql}" p:databasePlatform="org.hibernate.dialect.PostgreSQLDialect"/>
  41. </beans>