Commit 04783ae7 authored by Fjen Undso's avatar Fjen Undso
Browse files

models: some colums can be null

parent 7db910bf
......@@ -5,6 +5,7 @@ import java.util.Date;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
......@@ -32,6 +33,7 @@ public class Question extends Model {
public Boolean open;
@OneToMany(mappedBy = "question", cascade = CascadeType.ALL)
@Column(nullable = true)
public List<QuestionAnswer> answers = new ArrayList<>();
}
......@@ -2,6 +2,7 @@ package models;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
......@@ -25,6 +26,7 @@ public class QuestionAnswer extends Model {
@Formats.DateTime(pattern = "yyyy-MM-dd HH:mm:ss")
public Date date = new Date();
@Column(nullable = true)
public Integer vote;
}
......@@ -5,6 +5,7 @@ import java.util.Date;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
......@@ -32,9 +33,11 @@ public class Session extends Model {
public Boolean open;
@OneToMany(mappedBy = "session", cascade = CascadeType.ALL)
@Column(nullable = true)
public List<Vote> votes = new ArrayList<>();
@OneToMany(mappedBy = "session", cascade = CascadeType.ALL)
@Column(nullable = true)
public List<Question> questions = new ArrayList<>();
}
......@@ -2,6 +2,7 @@ package models;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
......@@ -25,6 +26,7 @@ public class Vote extends Model {
@Formats.DateTime(pattern = "yyyy-MM-dd HH:mm:ss")
public Date date = new Date();
@Column(nullable = true)
public Integer vote;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment