Spring?е???????????
???????????? ???????[ 2013/10/22 15:04:01 ] ????????
?????????
????test?????·????system??manage???????(??????package??·?????????????????????????)???????????????spring?????????(???spring???????????????????test+?????+Context)???????鼶????????(?????????spring????????????????????????????и???)?????????·??????????DAO??service?????????е?DAO??service??????????????????????spring???????testApplicationContext.xml???????????????????????????????????????
testApplicationContext.xml
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>jdbc.properties</value>
</list>
</property>
</bean>
<bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<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="parentSessionFactory" abstract="true"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.Oracle9Dialect
</prop>
<prop key="hibernate.cache.provider_class">
org.hibernate.cache.EhCacheProvider
</prop>
<prop key="hibernate.max_fetch_depth">3</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.cglib.use_reflection_optimizer">
true
</prop>
</props>
</property>
<property name="dataSource">
<ref local="dataSource" />
</property>
</bean>
<!-- transaction -->
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="baseTransactionProxy"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"
abstract="true">
<property name="transactionManager" ref="transactionManager" />
<property name="transactionAttributes">
<props>
<prop key="*">
PROPAGATION_REQUIRED?? -ApplicationException
</prop>
<prop key="load*">PROPAGATION_REQUIRED??readOnly</prop>
<prop key="get*">PROPAGATION_REQUIRED??readOnly</prop>
<prop key="find*">PROPAGATION_REQUIRED??readOnly</prop>
<prop key="list*">PROPAGATION_REQUIRED??readOnly</prop>
</props>
</property>
</bean>
<!-- Base DAO -->
<bean id="baseDAO" abstract="true"
class="com.mycompany.myproject.framework.BaseDAOImpl">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
??????
???·???
??????????????????
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