01: package org.osbl.persistence.hibernate;
02:
03: import org.osbl.persistence.LoadCommand;
04: import org.osbl.persistence.RevertCommand;
05: import org.hibernate.*;
06:
07: public class HibernateRevertCommand<T> extends RevertCommand implements
08: HibernateCommand {
09: SessionFactory sessionFactory;
10:
11: public void setSessionFactory(SessionFactory sessionFactory) {
12: this .sessionFactory = sessionFactory;
13: }
14:
15: public void execute() {
16: Session session = sessionFactory.getCurrentSession();
17: session.refresh(object);
18: Hibernate.initialize(object);
19: }
20: }
|