/*
 * Copyright (c) 2011, Patrik Dufresne. All rights reserved.
 * Patrik Dufresne PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.planimod.core;

import javax.persistence.Entity;
import javax.persistence.ManyToOne;

@Entity
public class NonAvailability extends AbstractCalendarEvent {

	private static final long serialVersionUID = 6384148771431566674L;

	/**
	 * Employee property
	 */
	public static final String EMPLOYEE = "employee"; //$NON-NLS-1$

	public static final String VISIBLE = "visible"; //$NON-NLS-1$

	private Employee employee;

	private boolean visible = true;

	public boolean isVisible() {
		return this.visible;
	}

	/**
	 * Sets the visibility of this non availability. This field is used to
	 * determine which non-availabilities to be displayed on report.
	 * 
	 * @param visible
	 *            True to display the non availability
	 */
	public void setVisible(boolean visible) {
		this.visible = visible;
	}

	@ManyToOne(optional = false)
	public Employee getEmployee() {
		return this.employee;
	}

	public void setEmployee(Employee employee) {
		this.changeSupport.firePropertyChange(EMPLOYEE, this.employee,
				this.employee = employee);
	}

}
