EventJob.java
/**
* TFG 75.678 - TFG Desarrollo web 2020 e-Learning for Schools
* Copyright (C) 2020 Eduardo Rodriguez Carro
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.uoc.tfg.sel.repository.model;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import org.springframework.lang.NonNull;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.sun.istack.NotNull;
/**
* Modelo de trabajos asociados a eventos.
*
* @author Eduardo Rodriguez carro
*/
@JsonInclude(value = Include.NON_NULL)
@Entity
@Table(name = "eventjob")
public class EventJob {
/** The id. */
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name = "id")
private Integer id;
/** The event. */
@ManyToOne(fetch = FetchType.LAZY)
@NonNull
@JoinColumn(name="event_id")
private Event event;
/** The student. */
@ManyToOne
@NonNull
@JoinColumn(name="student_id")
private User student;
/** The date. */
@NonNull
private Date date;
/** The content. */
@Column(name = "content")
private byte[] content;
/** The content type. */
@NotNull
@Size(min = 1,max = 200)
@Column(name = "content_name")
@JsonProperty("contentName")
private String contentName;
/** The content type. */
@NotNull
@Size(min = 1,max = 200)
@Column(name = "content_type")
@JsonProperty("contentType")
private String contentType;
/** The content size. */
@NonNull
@Column(name = "content_size")
@JsonProperty("contentSize")
private Integer contentSize;
/** The grade. */
private String grade;
/**
* Gets the id.
*
* @return the id
*/
public Integer getId() {
return id;
}
/**
* Sets the id.
*
* @param id the new id
*/
public void setId(Integer id) {
this.id = id;
}
/**
* Gets the event.
*
* @return the event
*/
public Event getEvent() {
return event;
}
/**
* Sets the event.
*
* @param event the new event
*/
public void setEvent(Event event) {
this.event = event;
}
/**
* Gets the student.
*
* @return the student
*/
public User getStudent() {
return student;
}
/**
* Sets the student.
*
* @param student the new student
*/
public void setStudent(User student) {
this.student = student;
}
/**
* Gets the date.
*
* @return the date
*/
public Date getDate() {
return date;
}
/**
* Sets the date.
*
* @param date the new date
*/
public void setDate(Date date) {
this.date = date;
}
/**
* Gets the content.
*
* @return the content
*/
public byte[] getContent() {
return content;
}
/**
* Sets the content.
*
* @param content the new content
*/
public void setContent(byte[] content) {
this.content = content;
}
/**
* Gets the content type.
*
* @return the content type
*/
public String getContentType() {
return contentType;
}
/**
* Sets the content type.
*
* @param contentType the new content type
*/
public void setContentType(String contentType) {
this.contentType = contentType;
}
/**
* Gets the content size.
*
* @return the content size
*/
public Integer getContentSize() {
return contentSize;
}
/**
* Sets the content size.
*
* @param contentSize the new content size
*/
public void setContentSize(Integer contentSize) {
this.contentSize = contentSize;
}
/**
* Gets the grade.
*
* @return the grade
*/
public String getGrade() {
return grade;
}
/**
* Sets the grade.
*
* @param grade the new grade
*/
public void setGrade(String grade) {
this.grade = grade;
}
/**
* Gets the content name.
*
* @return the content name
*/
public String getContentName() {
return contentName;
}
/**
* Sets the content name.
*
* @param contentName the new content name
*/
public void setContentName(String contentName) {
this.contentName = contentName;
}
}