Spring?е???????????
???????????? ???????[ 2013/10/22 15:04:01 ] ????????
???????е?spring???????????????????????棬????????????spring???????ü?????????????????parentSessionFactory????????????????sessionFactory?????????????????????????????????????
testSystemContext.xml
<bean id="sessionFactory" parent="parentSessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="mappingDirectoryLocations">
<list>
<value>
com/mycompany/myproject/domain/system/maps
</value>
</list>
</property>
</bean>
<!-- DAO -->
<bean id="userDAO" parent="baseDAO"
class="com.mycompany.myproject.module.system.dao.UserDAOImpl">
<constructor-arg>
<value>com.mycompany.myproject.domain.system.User</value>
</constructor-arg>
</bean>
<!-- Service -->
<bean id="userService" parent="baseTransactionProxy">
<property name="target">
<bean
class="com.mycompany.myproject.module.system.service.UserServiceImpl">
<property name="userDAO" ref="userDAO" />
</bean>
</property>
</bean>
?????????????У?????????????parentSessionFactory??sessionFactory?????????mappingDirectoryLocations
AbstractSystemTest.java
public abstract class AbstractSystemTest extends
AbstractTransactionalDataSourceSpringContextTests ...{
protected String[] getConfigLocations() ...{
String[] config = new String[] ...{ "testApplicationContext.xml"??
"system/testSystemContext.xml" };
return config;
}
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11