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