spring中对一些常见的问题有包装了
解决方案 »
- 关于hibernate二级缓存出现的问题,求教
- 高人请进strut2,tomcat启动问题
- 关于过滤器的问题
- Open flash chart 如何 生成 堆积图
- URL传值,怎样传递特殊字符?
- 从URL获取文件保存到本地的JAVA代码
- 求Struts+EJB+Hibernate入门小实例
- 使用 JNI 调用 c 的 DLL (问题)
- 想搞软件设计,如何着手?
- 第二次make时出现java.lang.OutOfMemoryError?
- ibatis框架中在*SqlMap.xml中配置SQL语句,与ScriptRunner 类执行SQL语句脚本文件的区别
- 为什么复合主键要复写equals和hashcode?
建议是不要用hibernate,直接ibatis挺好的
spring主要部分就是依赖注入方面
struts用的时候没感觉有什么
Spring API下的包
org.springframework.orm.hibernate.support
Class HibernateDaoSupportorg.springframework.orm.hibernate
Class HibernateTemplatespring声明式管理事物,举个例子:
<bean id="baseTransactionProxy"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean" abstract="true">
<property name="transactionManager" ref="transactionManager" />
<property name="transactionAttributes">
<props>
<prop key="add*">PROPAGATION_REQUIRED</prop>
<prop key="update*">PROPAGATION_REQUIRED</prop>
<prop key="modify*">PROPAGATION_REQUIRED</prop>
<prop key="sel*">PROPAGATION_REQUIRED,readOnly</prop>
<prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
<prop key="find*">PROPAGATION_REQUIRED,readOnly</prop>
</props>
</property>
</bean> <bean id="studentService"
class="com.huanglq.service.StudentServiceImpl">
<property name="studentDao" ref="studentDao" />
</bean>
<!-- 在DAO级别的代理事务 -->
<bean id="studentDaoTransactionProxy"
parent="baseTransactionProxy">
<property name="target" ref="studentDao" />
</bean>