Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?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"
- xmlns:beans="http://www.springframework.org/schema/mvc"
- 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.xsd
- http://www.springframework.org/schema/tx
- http://www.springframework.org/schema/tx/spring-tx.xsd
- http://www.springframework.org/schema/mvc
- http://www.springframework.org/schema/mvc/spring-mvc.xsd">
- <beans:bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
- destroy-method="close">
- <beans:property name="driverClassName" value="org.postgresql.Driver" />
- <beans:property name="url"
- value="jdbc:postgresql://localhost:5432/users" />
- <beans:property name="username" value="postgres" />
- <beans:property name="password" value="postgres" />
- <beans:property name="default_schema" value="public"/>
- </beans:bean>
- <!-- Hibernate 4 SessionFactory Bean definition -->
- <beans:bean id="hibernate4AnnotatedSessionFactory"
- class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
- <beans:property name="dataSource" ref="hibernate.cfg.xml" />
- <beans:property name="annotatedClasses">
- <beans:list>
- <beans:value>com.robertson.userManagement.model.User</beans:value>
- </beans:list>
- </beans:property>
- <beans:property name="hibernateProperties">
- <beans:props>
- <beans:prop key="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect
- </beans:prop>
- <beans:prop key="hibernate.show_sql">true</beans:prop>
- </beans:props>
- </beans:property>
- </beans:bean>
- <beans:bean id="userDao" class="com.robertson.userManagement.dao.UserDaoImpl">
- <beans:property name="sessionFactory" ref="hibernate4AnnotatedSessionFactory" />
- </beans:bean>
- <beans:bean id="userService" class="com.robertson.userManagement.service.UserServiceImpl">
- <beans:property name="userDao" ref="userDao"></beans:property>
- </beans:bean>
- <context:component-scan base-package="com.robertson.userManagement" />
- <beans:bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager">
- <beans:property name="sessionFactory" ref="hibernate4AnnotatedSessionFactory" />
- </beans:bean>
- </beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement