Select Git revision
Document.java 2.05 KiB
package hu.pazmany;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Column;
import jakarta.persistence.Table;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.JoinColumn;
import java.time.LocalDateTime;
@Entity
@Table(name = "DOCUMENTS")
public class Document {
@Id
@Column(name = "id", unique = true, nullable = false)
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@ManyToOne
@JoinColumn(name = "userId", nullable = false)
private hu.pazmany.User user;
@ManyToOne
@JoinColumn(name = "subjectId", nullable = false)
private Subject subject;
@Column(name = "title", nullable = false)
private String title;
@Column(name = "description")
private String description;
@Column(name = "uploaded")
private LocalDateTime uploaded;
@Column(name = "filepath", nullable = false)
private String filepath;
// Getters and setters
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public hu.pazmany.User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
public Subject getSubject() {
return subject;
}
public void setSubject(Subject subject) {
this.subject = subject;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public LocalDateTime getUploaded() {
return uploaded;
}
public void setUploaded(LocalDateTime uploaded) {
this.uploaded = uploaded;
}
public String getFilepath() {
return filepath;
}
public void setFilepath(String filepath) {
this.filepath = filepath;
}
}