/*
 * Created on Apr 12, 2005
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package gov.va.med.fw.service;

//Framework classes
import gov.va.med.fw.model.AbstractKeyedEntity;
/**
 * @author DNS   CHENB
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class ServiceOptimisticLockException extends ServiceException {

	/**
	 * An instance of serialVersionUID
	 */
	private static final long serialVersionUID = 4458957607708847132L;
	private AbstractKeyedEntity entity = null;

	/**
	 * 
	 */
	public ServiceOptimisticLockException() {
		super();
		// TODO Auto-generated constructor stub
	}
	/**
	 * Constructs an <code>ServiceException</code> with the specified detail message.
	 * @param msg the detail message.
	 */
	public ServiceOptimisticLockException(String msg) {
		super(msg);
	}
	/**
	 * Constructs an <code>ServiceException</code> with the specified detail message
	 * caused exception and the entity caused the exception
	 * @param msg the detail message.
	 * @param enity that caused the exception
	 */
	public ServiceOptimisticLockException(String msg, 
			AbstractKeyedEntity entity) {
		super(msg);
		this.entity = entity;
	}	
	/**
	 * Constructs an <code>ServiceException</code> with the specified detail message
	 * and a caused exception
	 * @param msg the detail message.
	 * @param cause the caused exception
	 */
	public ServiceOptimisticLockException(String msg, Throwable cause) {
		super( msg, cause );
	}

	/**
	 * Constructs an <code>ServiceException</code> with the specified detail message
	 * caused exception and the entity caused the exception
	 * @param msg the detail message.
	 * @param cause the caused exception
	 * @param enity that caused the exception
	 */
	public ServiceOptimisticLockException(String msg, Throwable cause, 
			AbstractKeyedEntity entity) {
		super( msg, cause );
		this.entity = entity;
	}
	/**
	 * returns the entity that caused the exception
	 * @return
	 */
	public AbstractKeyedEntity getEntity() {
		return entity;
	}
	/**
	 * Set the entity that caused the exception
	 * @param entity
	 */
	public void setEntity(AbstractKeyedEntity entity) {
		this.entity = entity;
	}
}
