package com.k_int.npdb.datamodel;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.Lob;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

/**
 * Class Event
 */
@Entity
@Table(name = "EVENT")
public class Event {

	private Long id;
	private String name;
	private String description;
	private List<Performance> performances;

	public Event() {
	};

	
	/**
	 * Get the value of id
	 * 
	 * @return the value of id
	 */
	@Id
	@Column(name = "ID")
	@GeneratedValue(strategy = GenerationType.AUTO)
	public Long getId() {
		return id;
	}

	/**
	 * Get the value of name
	 * 
	 * @return the value of name
	 */
	@Column(name = "NAME")
	public String getName() {
		return name;
	}

	/**
	 * Get the value of description
	 * 
	 * @return the value of description
	 */
	@Column(name = "DESCRIPTION")
	@Lob
	public String getDescription() {
		return description;
	}

	@ManyToMany
	@JoinTable(name = "PERFORMANCE_EVENT", joinColumns = { @JoinColumn(name = "EVENT_FK") }, inverseJoinColumns = @JoinColumn(name = "PERFORMANCE_FK"))
	public List<Performance> getPerformances() {
		return performances;
	}


	public void setDescription(String description) {
		this.description = description;
	}


	public void setId(Long id) {
		this.id = id;
	}


	public void setName(String name) {
		this.name = name;
	}


	public void setPerformances(List<Performance> performances) {
		this.performances = performances;
	}
	
	

}
