<?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:jpa="http://www.springframework.org/schema/data/jpa"
   	xmlns:tx="http://www.springframework.org/schema/tx" 
 	xmlns:p="http://www.springframework.org/schema/p"
  	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.0.xsd
        http://www.springframework.org/schema/data/jpa 
    	http://www.springframework.org/schema/data/jpa/spring-jpa.xsd
    	http://www.springframework.org/schema/tx
 		http://www.springframework.org/schema/tx/spring-tx.xsd">

    <context:annotation-config />
	<context:component-scan base-package="org.dataone.cn.index, org.dataone.cn.indexer"/>

    <bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor"/>
    
	<import resource="classpath:org/dataone/configuration/postgres-datasource.xml" />
	
	<jpa:repositories base-package="org.dataone.cn.index" />
	
    <bean id="entityManagerFactory"
       class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
       p:dataSource-ref="dataSource"
       p:jpaVendorAdapter-ref="jpaVendorAdapter"
       p:packagesToScan="org.dataone.cn.index.task" /> 
  
    <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"
       p:entityManagerFactory-ref="entityManagerFactory"
       p:dataSource-ref="dataSource"/>

    <tx:annotation-driven/>
    
    <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />
	
</beans>