|
From: Lars F. <lar...@gm...> - 2003-08-18 11:41:51
|
Hi to all Spring-experts, I'm trying to write a sample app with Spring and Hibernate (two new technologies for me). To get started I'm using some of the methods from Petclinic. My question is about "appicationContext.xml" where Petclinic declares (for JDBC): <!-- petclinic primary Business Object : Default implementation --> <bean id="clinic" class="petclinic.jdbc.HsqlClinic"> <property name="dataSource"><ref bean="dataSource"/></property> </bean> --> How would you declare the same functionality when using Hibernate ? This is from the "applicationContext.xml" template for Hibernate: <bean id="exampleDataAccessObject" class="example.ExampleDataAccessObject"> <property name="sessionFactory"><ref bean="mySessionFactory"/></property> <property name="exampleParam"><value>someValue</value></property> </bean> <bean id="exampleBusinessObject" class="example.ExampleBusinessObject"> <property name="transactionManager"><ref bean="myTransactionManager"/></property> <property name="dataAccessObject"><ref bean="exampleDataAccessObject"/></property> <property name="exampleParam"><value>someOtherValue</value></property> </bean> --> Do I need both of them ? Thanks a lot for your help ! Lars |