配置文件1---applicationContext-database1.xml: <bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName">
<value>${jdbc.driverClassName}</value>
</property>
<property name="url">
<value>${jdbc.url}</value>
</property>
<property name="username">
<value>${jdbc.username}</value>
</property>
<property name="password">
<value>${jdbc.password}</value>
</property>
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.Oracle9Dialect
</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.cache.provider_class">
org.hibernate.cache.EhCacheProvider
</prop>
<prop key="hibernate.cache.use_query_cache">true</prop>
<prop key="hibernate.cache.use_second_level_cache">
true
</prop>
<prop key="net.sf.ehcache.configurationResourceName">
classpath:com/founder/ocnbdmp/resource/ehcache.xml
</prop> </props>
</property>
<property name="mappingResources">
<list>
<value>
com/founder/ocnbdmp/sys/domain/hbm/Group.hbm.xml
</value>
<value>
com/founder/ocnbdmp/sys/domain/hbm/User.hbm.xml
</value>
</list>
</property>
</bean> <bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="baseTxService" abstract="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager" ref="transactionManager"/>
<property name="transactionAttributes">
<props>
<prop key="create*">PROPAGATION_REQUIRED</prop>
<prop key="update*">PROPAGATION_REQUIRED</prop>
<prop key="delete*">PROPAGATION_REQUIRED</prop>
<prop key="get*">PROPAGATION_REQUIRED, readOnly</prop>
<prop key="*">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>
  
  <bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
        <property name="sessionFactory" ref="sessionFactory"/>  </bean>  <bean id="jdbcTemplate"
   class="org.springframework.jdbc.core.JdbcTemplate">
   <property name="dataSource">
    <ref bean="dataSource" />
   </property>
  </bean> <tx:annotation-driven/> <aop:aspectj-autoproxy/> <aop:config proxy-target-class="true">
<aop:advisor pointcut="execution(* org.founder.ocnbdmp..*Service.*(..))" advice-ref="txAdvice"/>
<aop:advisor pointcut="execution(* org.founder.ocnbdmp.util.dao.*Dao.*(..))" advice-ref="txAdvice"/>
</aop:config> <tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="get*" read-only="true"/>
<tx:method name="*" rollback-for="Exception"/>   
</tx:attributes>
</tx:advice>
配置文件2---applicationContext-database2.xml: 文件内容和上面类似,只是Bean的id不同,datasource数据源不同而已,现在我想给这两个数据库中的表做Hibernate的级联关系,请教应该怎么配置啊?能帮我配一下吗? 谢谢了