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

import java.io.Serializable;

import javax.persistence.Entity;

import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;


/**
 * @author christiancorsano
 *
 */
@Entity
@IdClass(RatingPK.class)
public class Rating implements Serializable
{
	
	private static final long serialVersionUID = 1L;
	
		
	@Id
	@ManyToOne(targetEntity=Criterion.class)//,fetch=FetchType.EAGER)
	@JoinColumn(name="criterion_id",nullable=false)
	private Criterion criterion;
	
	@Id
	@ManyToOne(targetEntity=Report.class)
	@JoinColumn(name="report_id",nullable=false)
	private Report report;

	private Integer value;
	
	public Rating(){
		super();
	}
	
	public Rating(Integer value, Criterion criterion, Report report) {
		super();
		this.value = value;
		this.criterion = criterion;
		this.report = report;
	}	
	
	
	/**
	 * @return the value
	 */
	public Integer getValue() {
		return value;
	}
	/**
	 * @param value the value to set
	 */
	public void setValue(Integer value) {
		this.value = value;
	}
	/**
	 * @return the criterion
	 */
	@ManyToOne(targetEntity=Criterion.class)
	@JoinColumn(name="criterion_id",nullable=false)
	public Criterion getCriterion() {
		return criterion;
	}
	/**
	 * @param criterion the criterion to set
	 */
	@ManyToOne(targetEntity=Criterion.class)
	@JoinColumn(name="criterion_id",nullable=false)
	public void setCriterion(Criterion criterion) {
		this.criterion = criterion;
	}
	/**
	 * @return the report
	 */
	@ManyToOne(targetEntity=Report.class)
	@JoinColumn(name="report_id",nullable=false)
	public Report getReport() {
		return report;
	}
	/**
	 * @param report the report to set
	 */
	@ManyToOne(targetEntity=Report.class)
	@JoinColumn(name="report_id",nullable=false)
	public void setReport(Report report) {
		this.report = report;
	}

	
	
	
}
