Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public interface UserDao extends GenericDao<User, String>{
- public class UserDaoImpl extends GenericDaoImpl<User, String> implements UserDao {
- public UserDaoImpl() {
- super(User.class);
- }
- <?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:mvc="http://www.springframework.org/schema/mvc"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:p="http://www.springframework.org/schema/p"
- xmlns:aop="http://www.springframework.org/schema/aop"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xmlns:util="http://www.springframework.org/schema/util"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
- http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.3.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd
- http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd
- http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.3.xsd
- http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.3.xsd">
- <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
- p:location="classpath:database.properties" />
- <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"
- p:driverClassName="${database.driverClassName}"
- p:url="${database.url}"
- p:username="${database.username}"
- p:password="${database.password}" />
- <bean id="sessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
- <property name="dataSource" ref="dataSource" />
- <property name="configLocation">
- <value>classpath:hibernate.cfg.xml</value>
- </property>
- <property name="hibernateProperties">
- <props>
- <prop key="current_session_context_class">thread</prop>
- <prop key="hibernate.show_sql">true</prop>
- <prop key="fomat_sql">true</prop>
- <prop key="hibernate.hbm2ddl.auto">none</prop>
- <prop key="hibernate.connection.SetBigStringTryBlob">true</prop>
- <prop key="hibernate.connection.autocommit">true</prop>
- <prop key="hibername.jdbc.batch_size">0</prop>
- </props>
- </property>
- </bean>
- <bean id = "transactionManager" class = "org.springframework.orm.hibernate5.HibernateTransactionManager">
- <property name = "sessionFactory" ref = "sessionFactory" />
- </bean>
- <tx:annotation-driven transaction-manager="transactionManager" />
- <bean id="userDao" class="com.hlc.itam.repository.UserDaoImpl">
- <property name="sessionFactory">
- <ref bean="sessionFactory"/>
- </property>
- </bean>
Add Comment
Please, Sign In to add comment