Advertisement
bctoffolo

Maven applicationContext.xml file

May 9th, 2012
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 3.79 KB | None | 0 0
  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"
  4.       xmlns:p="http://www.springframework.org/schema/p"
  5.       xmlns:aop="http://www.springframework.org/schema/aop"
  6.       xmlns:tx="http://www.springframework.org/schema/tx"
  7.       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
  8.       http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
  9.       http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
  10.  
  11.     <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
  12.         <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
  13.         <property name="url" value="jdbc:mysql://localhost:3306/bruno" />
  14.         <property name="username" value="bruno" />
  15.         <property name="password" value="bruno" />
  16.     </bean>
  17.     <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
  18.         <property name="dataSource" ref="dataSource" />
  19.         <property name="configLocation" value="hibernate.cfg.xml" />
  20.         <property name="packagesToScan">
  21.             <list>
  22.                 <value>muitobafao.model</value>
  23.                 <value>muitobafao.dao</value>
  24.             </list>
  25.         </property>
  26.         <property name="hibernateProperties">
  27.             <props>
  28.                 <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
  29.                 <prop key="hibernate.connection.driver_class">com.mysql.jdbc.Driver</prop>
  30.                 <prop key="hibernate.connection.url">jdbc:mysql://localhost:3306/bruno</prop>
  31.                 <prop key="hibernate.connection.username">bruno</prop>
  32.                 <prop key="hibernate.connection.password">bruno</prop>
  33.                 <prop key="hibernate.hbm2ddl.auto">create</prop>
  34.                 <prop key="hibernate.show_sql">true</prop>
  35.                 <prop key="hibernate.format_sql">true</prop>
  36.             </props>
  37.         </property>
  38.     </bean>
  39.    
  40.     <!-- Hibernate Template bean that will be assigned to DAOs. -->  
  41.     <bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
  42.         <property name="sessionFactory" ref="sessionFactory" />
  43.     </bean>
  44.    
  45.     <!-- Transaction manager for a single Hibernate SessionFactory (alternative to JTA) -->  
  46.     <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
  47.         <property name="sessionFactory" ref="sessionFactory" />
  48.     </bean>
  49.    
  50.     <!-- Hibernate DAOs -->
  51.     <bean id="administradorDao" class="muitobafao.dao.HibernateAdministradorDao">
  52.         <property name="sessionFactory" ref="sessionFactory" />
  53.     </bean>
  54.     <bean id="comentarioDao" class="muitobafao.dao.HibernateComentarioDao">
  55.         <property name="sessionFactory" ref="sessionFactory" />
  56.     </bean>
  57.     <bean id="eventoDao" class="muitobafao.dao.HibernateEventoDao">
  58.         <property name="sessionFactory" ref="sessionFactory" />
  59.     </bean>
  60.     <bean id="listaDao" class="muitobafao.dao.HibernateListaDao">
  61.         <property name="sessionFactory" ref="sessionFactory" />
  62.     </bean>
  63.     <bean id="notificacaoDao" class="muitobafao.dao.HibernateNotificacaoDao">
  64.         <property name="sessionFactory" ref="sessionFactory" />
  65.     </bean>
  66.     <bean id="resenhaDao" class="muitobafao.dao.HibernateResenhaDao">
  67.         <property name="sessionFactory" ref="sessionFactory" />
  68.     </bean>
  69.     <bean id="usuarioDao" class="muitobafao.dao.HibernateUsuarioDao">
  70.         <property name="sessionFactory" ref="sessionFactory" />
  71.     </bean>
  72.  
  73. </beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement