Guest User

Untitled

a guest
Jan 12th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.94 KB | None | 0 0
  1. public interface UserDao extends GenericDao<User, String>{
  2.  
  3. public class UserDaoImpl extends GenericDaoImpl<User, String> implements UserDao {
  4.  
  5. public UserDaoImpl() {
  6. super(User.class);
  7. }
  8.  
  9. <?xml version="1.0" encoding="UTF-8"?>
  10. <beans xmlns="http://www.springframework.org/schema/beans"
  11. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  12. xmlns:mvc="http://www.springframework.org/schema/mvc"
  13. xmlns:context="http://www.springframework.org/schema/context"
  14. xmlns:p="http://www.springframework.org/schema/p"
  15. xmlns:aop="http://www.springframework.org/schema/aop"
  16. xmlns:tx="http://www.springframework.org/schema/tx"
  17. xmlns:util="http://www.springframework.org/schema/util"
  18. xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
  19. http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.3.xsd
  20. http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd
  21. http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd
  22. http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.3.xsd
  23. http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.3.xsd">
  24.  
  25. <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
  26. p:location="classpath:database.properties" />
  27.  
  28. <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"
  29. p:driverClassName="${database.driverClassName}"
  30. p:url="${database.url}"
  31. p:username="${database.username}"
  32. p:password="${database.password}" />
  33.  
  34. <bean id="sessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
  35. <property name="dataSource" ref="dataSource" />
  36. <property name="configLocation">
  37. <value>classpath:hibernate.cfg.xml</value>
  38. </property>
  39. <property name="hibernateProperties">
  40. <props>
  41. <prop key="current_session_context_class">thread</prop>
  42. <prop key="hibernate.show_sql">true</prop>
  43. <prop key="fomat_sql">true</prop>
  44. <prop key="hibernate.hbm2ddl.auto">none</prop>
  45. <prop key="hibernate.connection.SetBigStringTryBlob">true</prop>
  46. <prop key="hibernate.connection.autocommit">true</prop>
  47. <prop key="hibername.jdbc.batch_size">0</prop>
  48. </props>
  49. </property>
  50. </bean>
  51.  
  52. <bean id = "transactionManager" class = "org.springframework.orm.hibernate5.HibernateTransactionManager">
  53. <property name = "sessionFactory" ref = "sessionFactory" />
  54. </bean>
  55.  
  56. <tx:annotation-driven transaction-manager="transactionManager" />
  57.  
  58. <bean id="userDao" class="com.hlc.itam.repository.UserDaoImpl">
  59. <property name="sessionFactory">
  60. <ref bean="sessionFactory"/>
  61. </property>
  62. </bean>
Add Comment
Please, Sign In to add comment