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"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
- http://www.springframework.org/schema/context
- http://www.springframework.org/schema/context/spring-context-3.0.xsd">
- <context:component-scan base-package="spring.core" />
- <context:property-placeholder location="classpath:application.properties" />
- <bean id="helloSpring" class="spring.core.SpringFirst">
- <property name="greetings" value="Hello there !!! " />
- </bean>
- <bean id="xyz" class="com.value.ValueCheck"></bean>
- <bean id="awbcc" class="spring.core.AutoWireByConstructorCategories"
- autowire="constructor">
- <property name="name" value="Misc Books" />
- </bean>
- <bean id="awbcb" class="spring.core.AutoWireByConstructorBook">
- <property name="bookname" value="Dummies" />
- <property name="bookprice" value="400" />
- </bean>
- <bean id="lifeCycle" class="spring.core.BeanLifeCycle"
- init-method="init" destroy-method="destroy">
- <property name="message" value="Hello LIFE CYCLE BEAN !!! " />
- </bean>
- <bean id="empCI" class="spring.core.EmployeeDIByConstructor">
- <constructor-arg value="40" type="int"></constructor-arg>
- <constructor-arg value="Rajeev K Mohan"></constructor-arg>
- </bean>
- <bean id="quesCI" class="spring.core.CICollection">
- <constructor-arg value="111"></constructor-arg>
- <constructor-arg value="What is Spring "></constructor-arg>
- <constructor-arg>
- <list>
- <value>Spring is a Framework.</value>
- <value>Spring is a open source.</value>
- <value>Spring is developed by Rod J.</value>
- <value>Spring is flexible and testable .</value>
- </list>
- </constructor-arg>
- </bean>
- <bean id="setterInjection" class="spring.core.EmployeeDIBySetter">
- <property name="id">
- <value>199316</value>
- </property>
- <property name="name">
- <value>Rajeev K Mohan</value>
- </property>
- <property name="city">
- <value>Greater Noida , NCR </value>
- </property>
- </bean>
- <bean id="address" class="spring.core.SIWithDependentObject">
- <property name="addressLine1" value="C-905 , Ehomes"></property>
- <property name="city" value="Greater Noida"></property>
- <property name="state" value="UP"></property>
- <property name="country" value="India"></property>
- </bean>
- <bean id="empObj" class="spring.core.SIWithDependentObject2">
- <property name="id" value="199316"></property>
- <property name="name" value="Rajeev K Mohan"></property>
- <property name="address" ref="address"></property>
- </bean>
- <bean id="b1" class="spring.core.AutoWiringB"></bean>
- <bean id="a" class="spring.core.AutoWiringA" autowire="byName"></bean>
- <bean id="cat" class="spring.core.AutoWireCategories" autowire="byName">
- <property name="name" value="Misc. Books" />
- </bean>
- <bean id="bk" class="spring.core.AutoWireBook">
- <property name="bookname" value="Godfather" />
- <property name="bookprice" value="300" />
- </bean>
- <!-- JDBC Template -->
- <bean id="ds"
- class="org.springframework.jdbc.datasource.DriverManagerDataSource">
- <property name="driverClassName" value="com.mysql.jdbc.Driver" />
- <property name="url" value="jdbc:mysql://localhost:3306/spring" />
- <property name="username" value="root" />
- <property name="password" value="root" />
- </bean>
- <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
- <property name="dataSource" ref="ds"></property>
- </bean>
- <bean id="edao" class="spring.jdbctemplate.EmployeeDao">
- <property name="jdbcTemplate" ref="jdbcTemplate"></property>
- </bean>
- <!-- Spring Hibernate integration -->
- <!--aaaa -->
- <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
- <property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
- <property name="url" value="jdbc:mysql://localhost:3306/spring"></property>
- <property name="username" value="root"></property>
- <property name="password" value="root"></property>
- </bean>
- <bean id="mysessionFactory"
- class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
- <property name="dataSource" ref="dataSource"></property>
- <property name="mappingResources">
- <list>
- <value>employee.hbm.xml</value>
- </list>
- </property>
- <property name="hibernateProperties">
- <props>
- <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
- <prop key="hibernate.hbm2ddl.auto">create</prop>
- <prop key="hibernate.show_sql">true</prop>
- </props>
- </property>
- </bean>
- <bean id="template" class="org.springframework.orm.hibernate3.HibernateTemplate">
- <property name="sessionFactory" ref="mysessionFactory"></property>
- </bean>
- <bean id="d" class="spring.hibernte.EmployeeDao">
- <property name="template" ref="template"></property>
- </bean>
- <!-- bbbbb -->
- <!-- Spring Hibernate integration ends -->
- <bean id="scopes" class="spring.core.SpringScopeExample" scope="singleton"></bean>
- <bean id="scopep" class="spring.core.SpringScopeExample" scope="prototype"></bean>
- <!-- Spring EL -->
- <bean id="itemBean" class="spring.core.Item">
- <!-- <property name="name" value="book" /> <property name="qty" value="5"
- /> -->
- </bean>
- <bean id="customerBean" class="spring.core.Customer">
- <!-- <property name="item" value="#{itemBean}" /> <property name="itemName"
- value="#{itemBean.name}" /> -->
- </bean>
- </beans>
Add Comment
Please, Sign In to add comment