<?xml version="1.0" encoding="UTF-8"?>  
 <beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"   
       
     xmlns="http://www.springframework.org/schema/beans"  
     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-2.5.xsd  
                           
                         http://www.springframework.org/schema/context  
                         http://www.springframework.org/schema/context/spring-context-2.5.xsd  
                           
                         http://www.springframework.org/schema/tx  
                         http://www.springframework.org/schema/tx/spring-tx-2.5.xsd"> 


    <bean id="entityManagerFactory"
        class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
        <property name="persistenceUnitName" value="punit" />
        <property name="dataSource" ref="dataSource" />
        <property name="jpaVendorAdapter">
            <bean
                class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
                <property name="database" value="MYSQL" />
                <property name="showSql" value="true" />
                <property name="generateDdl" value="true"></property>
            </bean>
        </property>
    </bean>

    <bean id="dataSource"
        class="org.springframework.jdbc.datasource.DriverManagerDataSource">
        <property name="driverClassName" value="com.mysql.jdbc.Driver" />
        <property name="url" value="jdbc:mysql://localhost/locadora" />
        <property name="username" value="root" />
        <property name="password" value="123" />
    </bean>

    <bean id="transactionManager"
        class="org.springframework.orm.jpa.JpaTransactionManager">
        <property name="entityManagerFactory" ref="entityManagerFactory" />
    </bean>

    <tx:annotation-driven transaction-manager="transactionManager" />
   
   <!-- Actions -->
	<bean id="login" scope="prototype" class="locadora.servlets.Login" autowire="byName" />
	<bean id="listaVideos" scope="prototype" class="locadora.servlets.ListaVideos" autowire="byName" />
	<bean id="faleConosco" scope="prototype" class="locadora.servlets.FaleConosco" autowire="byName" />
	<bean id="cadastrarFilmes" scope="prototype" class="locadora.servlets.CadastrarFilmes" autowire="byName" />
	<bean id="buscaFilmes" scope="prototype" class="locadora.servlets.BuscaFilmes" autowire="byName" />
    
    
    <bean name="dao" class="locadora.hibernate.Dao" scope="prototype" autowire="byName"/>  
  

</beans>


