可以的
用面向切面的方式
比如把com包下面的biz包下面的所有类的所有方法(所有参数)都加上声明式事务
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="get*" read-only="true" />
<tx:method name="search*" read-only="true" />
<tx:method name="*" propagation="REQUIRED" />
</tx:attributes>
</tx:advice>
<aop:config>
<aop:pointcut id="aopPointcut" expression="execution(* com.biz..*.*(..))" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="aopPointcut" />
</aop:config>