/**
 * 
 */
package org.yacos.core.article;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import org.yacos.core.users.User;

/**
 * @author christiancorsano
 *
 */
@Entity
public class Delegation {
	/**
	 * Id mandatory in every entity.
	 */
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private Integer id;
	@ManyToOne(targetEntity=Article.class)
	@JoinColumn(name="article_id")
	private Article article;
	@ManyToOne(targetEntity=User.class)
	@JoinColumn(name="pcmember_id")
	private User pcMember;
	@ManyToOne(targetEntity=User.class)
	@JoinColumn(name="referee_id")
	private User referee;
	
	/**
	 * @return the id
	 */
	public Integer getId() {
		return id;
	}
	/**
	 * @param id the id to set
	 */
	public void setId(Integer id) {
		this.id = id;
	}
	
	/**
	 * Article being evaluated through this delegation
	 * @return the article
	 */
	@ManyToOne(targetEntity=Article.class)
	@JoinColumn(name="article_id")
	public Article getArticle() {
		return article;
	}
	/**
	 * Define the article evaluated through this delegation
	 * @param article the article to set
	 */
	@ManyToOne(targetEntity=Article.class)
	@JoinColumn(name="article_id")
	public void setArticle(Article article) {
		this.article = article;
	}
	/**
	 * PCMember that delegated the article to a referee
	 * @return the pcMember
	 */
	@ManyToOne(targetEntity=User.class)
	@JoinColumn(name="pcmember_id")
	public User getPcMember() {
		return pcMember;
	}
	/**
	 * Set PCMember that delegated the article to a referee
	 * @param pcMember the pcMember to set
	 */
	@ManyToOne(targetEntity=User.class)
	@JoinColumn(name="pcmember_id")
	public void setPcMember(User pcMember) {
		this.pcMember = pcMember;
	}
	/**
	 * Get the referee that will evaluate this article
	 * @return the referee
	 */
	@ManyToOne(targetEntity=User.class)
	@JoinColumn(name="referee_id")
	public User getReferee() {
		return referee;
	}
	/**
	 * Get 
	 * @param referee the referee to set
	 */
	@ManyToOne(targetEntity=User.class)
	@JoinColumn(name="referee_id")
	public void setReferee(User referee) {
		this.referee = referee;
	}
	
	
}
