Guest User

Untitled

a guest
Jan 29th, 2018
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.55 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" xmlns:context="http://www.springframework.org/schema/context"
  4. xsi:schemaLocation="http://www.springframework.org/schema/beans
  5. http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
  6. http://www.springframework.org/schema/context
  7. http://www.springframework.org/schema/context/spring-context-3.0.xsd">
  8.  
  9. <context:component-scan base-package="spring.core" />
  10. <context:property-placeholder location="classpath:application.properties" />
  11.  
  12. <bean id="helloSpring" class="spring.core.SpringFirst">
  13. <property name="greetings" value="Hello there !!! " />
  14. </bean>
  15.  
  16. <bean id="xyz" class="com.value.ValueCheck"></bean>
  17.  
  18.  
  19. <bean id="awbcc" class="spring.core.AutoWireByConstructorCategories"
  20. autowire="constructor">
  21. <property name="name" value="Misc Books" />
  22. </bean>
  23. <bean id="awbcb" class="spring.core.AutoWireByConstructorBook">
  24. <property name="bookname" value="Dummies" />
  25. <property name="bookprice" value="400" />
  26. </bean>
  27.  
  28. <bean id="lifeCycle" class="spring.core.BeanLifeCycle"
  29. init-method="init" destroy-method="destroy">
  30. <property name="message" value="Hello LIFE CYCLE BEAN !!! " />
  31. </bean>
  32.  
  33. <bean id="empCI" class="spring.core.EmployeeDIByConstructor">
  34. <constructor-arg value="40" type="int"></constructor-arg>
  35. <constructor-arg value="Rajeev K Mohan"></constructor-arg>
  36. </bean>
  37.  
  38.  
  39.  
  40. <bean id="quesCI" class="spring.core.CICollection">
  41. <constructor-arg value="111"></constructor-arg>
  42. <constructor-arg value="What is Spring "></constructor-arg>
  43. <constructor-arg>
  44. <list>
  45. <value>Spring is a Framework.</value>
  46. <value>Spring is a open source.</value>
  47. <value>Spring is developed by Rod J.</value>
  48. <value>Spring is flexible and testable .</value>
  49. </list>
  50. </constructor-arg>
  51. </bean>
  52. <bean id="setterInjection" class="spring.core.EmployeeDIBySetter">
  53. <property name="id">
  54. <value>199316</value>
  55. </property>
  56. <property name="name">
  57. <value>Rajeev K Mohan</value>
  58. </property>
  59. <property name="city">
  60. <value>Greater Noida , NCR </value>
  61. </property>
  62. </bean>
  63.  
  64.  
  65. <bean id="address" class="spring.core.SIWithDependentObject">
  66. <property name="addressLine1" value="C-905 , Ehomes"></property>
  67. <property name="city" value="Greater Noida"></property>
  68. <property name="state" value="UP"></property>
  69. <property name="country" value="India"></property>
  70. </bean>
  71.  
  72. <bean id="empObj" class="spring.core.SIWithDependentObject2">
  73. <property name="id" value="199316"></property>
  74. <property name="name" value="Rajeev K Mohan"></property>
  75. <property name="address" ref="address"></property>
  76. </bean>
  77.  
  78. <bean id="b1" class="spring.core.AutoWiringB"></bean>
  79. <bean id="a" class="spring.core.AutoWiringA" autowire="byName"></bean>
  80.  
  81. <bean id="cat" class="spring.core.AutoWireCategories" autowire="byName">
  82. <property name="name" value="Misc. Books" />
  83. </bean>
  84. <bean id="bk" class="spring.core.AutoWireBook">
  85. <property name="bookname" value="Godfather" />
  86. <property name="bookprice" value="300" />
  87. </bean>
  88. <!-- JDBC Template -->
  89.  
  90. <bean id="ds"
  91. class="org.springframework.jdbc.datasource.DriverManagerDataSource">
  92. <property name="driverClassName" value="com.mysql.jdbc.Driver" />
  93. <property name="url" value="jdbc:mysql://localhost:3306/spring" />
  94. <property name="username" value="root" />
  95. <property name="password" value="root" />
  96. </bean>
  97.  
  98. <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
  99. <property name="dataSource" ref="ds"></property>
  100. </bean>
  101.  
  102. <bean id="edao" class="spring.jdbctemplate.EmployeeDao">
  103. <property name="jdbcTemplate" ref="jdbcTemplate"></property>
  104. </bean>
  105.  
  106.  
  107.  
  108. <!-- Spring Hibernate integration -->
  109.  
  110. <!--aaaa -->
  111. <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
  112. <property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
  113. <property name="url" value="jdbc:mysql://localhost:3306/spring"></property>
  114. <property name="username" value="root"></property>
  115. <property name="password" value="root"></property>
  116. </bean>
  117. <bean id="mysessionFactory"
  118. class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
  119. <property name="dataSource" ref="dataSource"></property>
  120. <property name="mappingResources">
  121. <list>
  122. <value>employee.hbm.xml</value>
  123. </list>
  124. </property>
  125. <property name="hibernateProperties">
  126. <props>
  127. <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
  128. <prop key="hibernate.hbm2ddl.auto">create</prop>
  129. <prop key="hibernate.show_sql">true</prop>
  130. </props>
  131. </property>
  132. </bean>
  133. <bean id="template" class="org.springframework.orm.hibernate3.HibernateTemplate">
  134. <property name="sessionFactory" ref="mysessionFactory"></property>
  135. </bean>
  136. <bean id="d" class="spring.hibernte.EmployeeDao">
  137. <property name="template" ref="template"></property>
  138. </bean>
  139. <!-- bbbbb -->
  140. <!-- Spring Hibernate integration ends -->
  141.  
  142. <bean id="scopes" class="spring.core.SpringScopeExample" scope="singleton"></bean>
  143. <bean id="scopep" class="spring.core.SpringScopeExample" scope="prototype"></bean>
  144.  
  145. <!-- Spring EL -->
  146.  
  147. <bean id="itemBean" class="spring.core.Item">
  148. <!-- <property name="name" value="book" /> <property name="qty" value="5"
  149. /> -->
  150. </bean>
  151.  
  152. <bean id="customerBean" class="spring.core.Customer">
  153. <!-- <property name="item" value="#{itemBean}" /> <property name="itemName"
  154. value="#{itemBean.name}" /> -->
  155. </bean>
  156. </beans>
Add Comment
Please, Sign In to add comment