Code example for SessionFactory

Methods: getCurrentSession

0
	/** 
	 * @see org.openmrs.api.db.OrderDAO#saveOrder(org.openmrs.Order) 
	 * @see org.openmrs.api.OrderService#saveOrder(org.openmrs.Order, org.openmrs.api.OrderContext) 
	 */ 
	public Order saveOrder(Order order) throws DAOException {
		sessionFactory.getCurrentSession().saveOrUpdate(order);
		 
		return order;
	} 
	 
	/** 
	 * @see org.openmrs.api.db.OrderDAO#deleteOrder(org.openmrs.Order) 
	 * @see org.openmrs.api.OrderService#purgeOrder(org.openmrs.Order) 
	 */ 
	public void deleteOrder(Order order) throws DAOException {
		sessionFactory.getCurrentSession().delete(order);
	} 
	 
	/** 
	 * @see org.openmrs.api.OrderService#getOrder(java.lang.Integer)