@Override
	public int delete(T obj) {
		Session session = HibernateUtil.getSession();
		try {
			session.beginTransaction();
			session.delete(obj);
			session.getTransaction().commit();
		} catch (HibernateException e) {
			session.getTransaction().rollback();
			error = e;
		} finally {
			HibernateUtil.closeSession();
		}
		return 1;
	}