/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.csu.sdmx.validation.model;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author themi
 */
@Entity
@Table(name = "SDMX_VALIDATION_ERRORS")
@XmlAccessorType(XmlAccessType.FIELD)
public class ValidationError implements Serializable {
    public static final String WARNING = "warning";
    public static final String ERROR = "error";
    public static final String FATAL = "fatal";
    
    @ManyToOne
    @JoinColumn(name = "VALIDATION_RESULT_ID")
    @XmlTransient
    private ValidationResult validationResult;
    
    @Id
    @GeneratedValue
    @Column(name = "ID")
    private int id;
    
    @Lob
    @Column(name = "TEXT")
    private String text;
    
    @Column(name = "TYPE")
    private String type;
    
    @Column(name = "ERROR_CODE")
    private String errorCode;
    
    @Column(name = "FILENAME")
    private String filename;
    
    @Column(name = "LINE_NUMBER")
    private String lineNumber;

    public ValidationResult getValidationResult() {
        return validationResult;
    }

    public void setValidationResult(ValidationResult validationResult) {
        this.validationResult = validationResult;
    }

    public int getId() {
        return id;
    }

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

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }

    public String getFilename() {
        return filename;
    }

    public void setFilename(String file) {
        this.filename = file;
    }

    public String getLineNumber() {
        return lineNumber;
    }

    public void setLineNumber(String lineNumber) {
        this.lineNumber = lineNumber;
    }

    
}
