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

import java.io.Serializable;

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.conferences.Conference;

/**
 * @author christiancorsano
 *
 */
@Entity
public class Criterion implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private Integer id;
	
	private String name;
	private Integer min_rating;
	private Integer max_rating;
	
	@ManyToOne(targetEntity=Conference.class)
	@JoinColumn(name="conference_id",nullable=false)
	private Conference conference;
	
	public Criterion( String name, Integer min_rating,
			Integer max_rating, Conference conference) {
		super();
		
		this.name = name;
		this.min_rating = min_rating;
		this.max_rating = max_rating;
		this.conference = conference;
	}

	public Criterion() {
	}

	@ManyToOne(targetEntity=Conference.class)
	@JoinColumn(name="conference_id",nullable=false)
	public Conference getConference(){
		return conference;
	}
	
	/**
	 * @param conference the conference to set
	 */
	@ManyToOne(targetEntity=Conference.class)
	@JoinColumn(name="conference_id",nullable=false)
	public void setConference(Conference conference) {
		this.conference = conference;
	}

	/**
	 * @return the id
	 */
	public Integer getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(Integer id) {
		this.id = id;
	}

	/**
	 * @return the name of this criterion
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name the name of this criterion
	 */
	public void setName(String name) {
		this.name = name;
	}


	public Integer getMin_rating() {
		return min_rating;
	}
	public void setMin_rating(Integer min_rating) {
		this.min_rating = min_rating;
	}

	public Integer getMax_rating() {
		return max_rating;
	}
	public void setMax_rating(Integer max_rating) {
		this.max_rating = max_rating;
	}
	
}
