共 13 篇文章 |
|
Write operations are not allowed in read-only mode (FlushMode.在这个过程中,若HibernateTemplate 发现自当前session有不是readOnly的transaction,就会获取到FlushMode.AUTO Session,使方法拥有写权限。也即是,如果有不是readOnly的transaction就可以由Flush.NEVER转为Flush.AUTO,拥有insert,update,delete操作权限,如果没有transactio... 阅1257 转5 评0 公众公开 06-12-09 22:19 |
在使用Spring的AOP编程时,会用到这几个lib:asm-2.2.2.jarasm-commons-2.2.2.jarasm-util-2.2.2.jar.2.加入Spring中的以下4个libasm-2.2.2.jarasm-commons-2.2.2.jarasm-util-2.2.2.jarcglib-nodep-2.1_3.jar. 阅2029 转3 评0 公众公开 06-12-09 00:15 |
<property name="transactionAttributes"> <props> <prop key="insert*">PROPAGATION_REQUIRED,-MyCheckedException,+MyUnCheckedException</prop> <prop key="update*">PROPAGATION_REQUIRED</prop> <prop key="*">PROPAGATION... 阅1033 转4 评0 公众公开 06-08-10 10:33 |
public Object doInHibernate(Session session) throws HibernateException { session.refresh(entity);public static void closeSessionIfNecessary(Session session, SessionFactory sessionFactory) throws CleanupFailureDataAccessException { if (session == null || Trans... 阅739 转5 评0 公众公开 06-08-08 11:52 |
spring应用示例spring中对hibernate的支持是非常强大的,从一个简单的例子就看得出来,从这个例子中我们还将对所谓的轻量级容器做一些讨论。但是我们有另外一种选择,spring直接提供了对sessionFactory的封装,你只需要注册一个spring自己的类,给它提供必须的属性,它会返回一个org.springframework.orm.hibernate.HibernateTemplate,这个类... 阅115 转自jiashengf... 公众公开 06-08-07 22:30 |
阅5604 转7 评0 公众公开 06-08-04 18:29 |
public interface BaseDAO { public Long add(Object object) throws HibernateException;} public class BaseManagerImpl {} 具体的UserDAO和UserManager如下: public interface UserDAO extends BaseDAO{} public interface UserManager extends BaseManager{} public class UserDAOImpl extends BaseDAOImpl implements UserDAO{} pub... 阅2825 转6 评0 公众公开 06-07-30 00:35 |
Here‘s a cool trick I learned recently in Spring MVC. In Equinox, I added a new Role class (it only has User) and created a many-to-many mapping between the two.<set name="roles" table="user_role" cascade="all"> <key column="user_id"/> <many-to-many c... 阅1169 转5 评0 公众公开 06-07-21 18:06 |
<bean id="openSessionInViewInterceptor"class="org.springframework.orm.hibernate.support.OpenSessionInViewInterceptor"><property name="sessionFactory"><ref bean="sessionFactory"/></property></bean><filter><filter-name>hibernateFilter</... 阅83 转5 评0 公众公开 06-07-17 16:19 |
Spring Web Flow aims to be the best solution for the management of web application page flow.<bean name="/booking.htm" class="org.springframework.web.flow.mvc.FlowController"><property name="flow"><ref bean="bookingFlow"/></property></bean><bean ... 阅701 转6 评0 公众公开 06-07-17 10:29 |