task/3382: Harmonisera tabellnamn #6
@ -1,6 +1,16 @@
|
|||||||
package se.su.dsv.scipro.match;
|
package se.su.dsv.scipro.match;
|
||||||
|
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.Basic;
|
||||||
|
import jakarta.persistence.Cacheable;
|
||||||
|
import jakarta.persistence.Column;
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.GeneratedValue;
|
||||||
|
import jakarta.persistence.GenerationType;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
import jakarta.persistence.JoinColumn;
|
||||||
|
import jakarta.persistence.OneToOne;
|
||||||
|
import jakarta.persistence.Table;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@ -9,72 +19,92 @@ import java.util.Objects;
|
|||||||
@Table(name = "idea_first_meeting")
|
@Table(name = "idea_first_meeting")
|
||||||
@Cacheable(true)
|
@Cacheable(true)
|
||||||
public class FirstMeeting implements Serializable {
|
public class FirstMeeting implements Serializable {
|
||||||
public static final int LENGTH = 1024;
|
private static final int LENGTH = 1024;
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
|
// basic JPA-mappings
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
@Basic(optional = false)
|
@Basic
|
||||||
private Date firstMeetingDate;
|
@Column(name = "description", nullable = true, length = LENGTH)
|
||||||
|
|
||||||
@Column(nullable = false, length = LENGTH)
|
|
||||||
private String room;
|
|
||||||
|
|
||||||
@Column(nullable = true, length = LENGTH)
|
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
|
@Basic(optional = false)
|
||||||
|
@Column(name = "first_meeting_date")
|
||||||
|
private Date firstMeetingDate;
|
||||||
|
|
||||||
|
@Basic
|
||||||
|
@Column(name = "room", nullable = false, length = LENGTH)
|
||||||
|
private String room;
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
|
// JPA-mappings of foreign keys in this table (idea_first_meeting) referencing other
|
||||||
|
// tables.
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
@OneToOne(optional = false)
|
@OneToOne(optional = false)
|
||||||
|
@JoinColumn(name = "idea_id", referencedColumnName = "id")
|
||||||
private Idea idea;
|
private Idea idea;
|
||||||
|
|
||||||
public FirstMeeting() {
|
// ----------------------------------------------------------------------------------
|
||||||
|
// constructors
|
||||||
}
|
// ----------------------------------------------------------------------------------
|
||||||
|
public FirstMeeting() { }
|
||||||
|
|
||||||
public FirstMeeting(Date firstMeetingDate, Idea idea) {
|
public FirstMeeting(Date firstMeetingDate, Idea idea) {
|
||||||
this.firstMeetingDate = firstMeetingDate;
|
this.firstMeetingDate = firstMeetingDate;
|
||||||
this.idea = idea;
|
this.idea = idea;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
|
// getters and setters
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return this.id;
|
return this.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Date getFirstMeetingDate() {
|
|
||||||
return this.firstMeetingDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getRoom() {
|
|
||||||
return this.room;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDescription() {
|
|
||||||
return this.description;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Idea getIdea() {
|
|
||||||
return this.idea;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(Long id) {
|
public void setId(Long id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFirstMeetingDate(Date firstMeetingDate) {
|
public String getDescription() {
|
||||||
this.firstMeetingDate = firstMeetingDate;
|
return this.description;
|
||||||
}
|
|
||||||
|
|
||||||
public void setRoom(String room) {
|
|
||||||
this.room = room;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDescription(String description) {
|
public void setDescription(String description) {
|
||||||
this.description = description;
|
this.description = description;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Date getFirstMeetingDate() {
|
||||||
|
return this.firstMeetingDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFirstMeetingDate(Date firstMeetingDate) {
|
||||||
|
this.firstMeetingDate = firstMeetingDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRoom() {
|
||||||
|
return this.room;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRoom(String room) {
|
||||||
|
this.room = room;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Idea getIdea() {
|
||||||
|
return this.idea;
|
||||||
|
}
|
||||||
|
|
||||||
public void setIdea(Idea idea) {
|
public void setIdea(Idea idea) {
|
||||||
this.idea = idea;
|
this.idea = idea;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
|
// other methods
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(final Object o) {
|
public boolean equals(final Object o) {
|
||||||
if (o == this) return true;
|
if (o == this) return true;
|
||||||
@ -94,11 +124,13 @@ public class FirstMeeting implements Serializable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(this.getId(), this.getFirstMeetingDate(), this.getRoom(), this.getDescription(), this.getIdea());
|
return Objects.hash(this.getId(), this.getFirstMeetingDate(), this.getRoom(), this.getDescription(),
|
||||||
|
this.getIdea());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "FirstMeeting(id=" + this.getId() + ", firstMeetingDate=" + this.getFirstMeetingDate() + ", room=" + this.getRoom() + ", description=" + this.getDescription() + ", idea=" + this.getIdea() + ")";
|
return "FirstMeeting(id=" + this.getId() + ", firstMeetingDate=" + this.getFirstMeetingDate() + ", room=" +
|
||||||
|
this.getRoom() + ", description=" + this.getDescription() + ", idea=" + this.getIdea() + ")";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,96 +50,137 @@ import java.util.stream.Collectors;
|
|||||||
@Table(name = "idea")
|
@Table(name = "idea")
|
||||||
@Cacheable(true)
|
@Cacheable(true)
|
||||||
public class Idea extends DomainObject {
|
public class Idea extends DomainObject {
|
||||||
|
private static final int DESCRIPTION_LENGTH = 4000;
|
||||||
|
private static final int PREREQUISITES_LENGTH = 4000;
|
||||||
|
private static final int TITLE_LENGTH = 1024;
|
||||||
|
|
||||||
public static final int DESCRIPTION_LENGTH = 4000;
|
// ----------------------------------------------------------------------------------
|
||||||
public static final int PREREQUISITES_LENGTH = 4000;
|
// basic and embedded JPA-mappings
|
||||||
public static final int TITLE_LENGTH = 1024;
|
// ----------------------------------------------------------------------------------
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
@Basic
|
||||||
|
@Column(nullable = true, length = DESCRIPTION_LENGTH)
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@Basic
|
||||||
|
@Column(nullable = true, length = PREREQUISITES_LENGTH)
|
||||||
|
private String prerequisites;
|
||||||
|
|
||||||
|
@Basic
|
||||||
|
@Column(nullable = false, length = TITLE_LENGTH)
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@Basic
|
||||||
|
@Enumerated(EnumType.STRING)
|
||||||
|
private Type type;
|
||||||
|
|
||||||
|
@Basic
|
||||||
|
@Column(name = "published")
|
||||||
|
private boolean published = true;
|
||||||
|
|
||||||
|
@Enumerated(EnumType.STRING)
|
||||||
|
@Column(name = "cached_status")
|
||||||
|
private Status cachedStatus;
|
||||||
|
|
||||||
|
@Basic
|
||||||
|
@Column(name = "inactive")
|
||||||
|
private boolean inactive = false;
|
||||||
|
|
||||||
|
@Embedded
|
||||||
|
@AttributeOverrides({
|
||||||
|
@AttributeOverride(name = "practicalHow", column = @Column(name = "practical_how", insertable = false, updatable = false)),
|
||||||
|
@AttributeOverride(name = "theoryHow", column = @Column(name = "theory_how", insertable = false, updatable = false)),
|
||||||
|
@AttributeOverride(name = "what", column = @Column(name = "what", insertable = false, updatable = false)),
|
||||||
|
@AttributeOverride(name = "why", column = @Column(name = "why", insertable = false, updatable = false)),
|
||||||
|
@AttributeOverride(name = "literature", column = @Column(name = "literature", insertable = false, updatable = false))
|
||||||
|
})
|
||||||
|
private Watson watson;
|
||||||
|
|
||||||
|
@Embedded
|
||||||
|
@AttributeOverrides({
|
||||||
|
@AttributeOverride(name = "literature", column = @Column(name = "literature", insertable = false, updatable = false)),
|
||||||
|
@AttributeOverride(name = "background", column = @Column(name = "background", insertable = false, updatable = false)),
|
||||||
|
@AttributeOverride(name = "problem", column = @Column(name = "problem", insertable = false, updatable = false)),
|
||||||
|
@AttributeOverride(name = "method", column = @Column(name = "method", insertable = false, updatable = false)),
|
||||||
|
@AttributeOverride(name = "interests", column = @Column(name = "interests", insertable = false, updatable = false))
|
||||||
|
})
|
||||||
|
private TholanderBox tholanderBox = new TholanderBox();
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
|
// JPA-mappings of foreign keys in this table (idea) referencing other tables.
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
|
@ManyToOne(optional = true)
|
||||||
|
@JoinColumn(name = "application_period_id", referencedColumnName = "id")
|
||||||
|
private ApplicationPeriod applicationPeriod;
|
||||||
|
|
||||||
|
@ManyToOne(optional = false)
|
||||||
|
@JoinColumn(name = "creator_user_id", referencedColumnName = "id")
|
||||||
|
private User creator;
|
||||||
|
|
||||||
|
@OneToOne(optional = true, cascade = CascadeType.ALL)
|
||||||
|
@JoinColumn(name = "match_id", referencedColumnName = "id")
|
||||||
|
@QueryInit({"supervisor.user", "supervisor.unit"})
|
||||||
|
private Match match;
|
||||||
|
|
||||||
|
@OneToOne
|
||||||
|
@JoinColumn(name = "project_id", referencedColumnName = "id")
|
||||||
|
private Project project;
|
||||||
|
|
||||||
@ManyToOne(optional = false)
|
@ManyToOne(optional = false)
|
||||||
@JoinColumn(name = "project_type_id", referencedColumnName = "id")
|
@JoinColumn(name = "project_type_id", referencedColumnName = "id")
|
||||||
private ProjectType projectType;
|
private ProjectType projectType;
|
||||||
|
|
||||||
@Enumerated(EnumType.STRING)
|
|
||||||
private Type type;
|
|
||||||
|
|
||||||
@ManyToOne(optional = false)
|
|
||||||
private User creator;
|
|
||||||
|
|
||||||
@Column(nullable = true, length = DESCRIPTION_LENGTH)
|
|
||||||
private String description;
|
|
||||||
|
|
||||||
@Column(nullable = true, length = PREREQUISITES_LENGTH)
|
|
||||||
private String prerequisites;
|
|
||||||
|
|
||||||
@OneToMany(fetch = FetchType.LAZY, mappedBy = "idea", cascade = CascadeType.ALL, orphanRemoval = true)
|
|
||||||
@QueryInit({"user", "program"})
|
|
||||||
private Set<IdeaParticipation> ideaParticipations = new HashSet<>();
|
|
||||||
|
|
||||||
@ManyToOne(optional = true)
|
|
||||||
@JoinColumn(name = "application_period_id", referencedColumnName = "id")
|
|
||||||
private ApplicationPeriod applicationPeriod;
|
|
||||||
|
|
||||||
@Column(nullable = false, length = TITLE_LENGTH)
|
|
||||||
private String title;
|
|
||||||
|
|
||||||
@ManyToOne(optional = true)
|
@ManyToOne(optional = true)
|
||||||
@JoinColumn(name = "research_area_id", referencedColumnName = "id")
|
@JoinColumn(name = "research_area_id", referencedColumnName = "id")
|
||||||
private ResearchArea researchArea;
|
private ResearchArea researchArea;
|
||||||
|
|
||||||
@ElementCollection
|
// ----------------------------------------------------------------------------------
|
||||||
@CollectionTable(name = "idea_language")
|
// @ManyToMany JPA-mappings
|
||||||
@Column(name = "language")
|
// ----------------------------------------------------------------------------------
|
||||||
@Enumerated(EnumType.STRING)
|
|
||||||
private Set<Language> languages = EnumSet.noneOf(Language.class);
|
|
||||||
|
|
||||||
@Embedded
|
|
||||||
@AttributeOverrides({
|
|
||||||
@AttributeOverride(name = "practicalHow", column = @Column(insertable = false, updatable = false)),
|
|
||||||
@AttributeOverride(name = "literature", column = @Column(insertable = false, updatable = false)),
|
|
||||||
@AttributeOverride(name = "theoryHow", column = @Column(insertable = false, updatable = false)),
|
|
||||||
@AttributeOverride(name = "why", column = @Column(insertable = false, updatable = false)),
|
|
||||||
@AttributeOverride(name = "what", column = @Column(insertable = false, updatable = false))
|
|
||||||
})
|
|
||||||
private Watson watson;
|
|
||||||
|
|
||||||
@Embedded
|
|
||||||
private TholanderBox tholanderBox = new TholanderBox();
|
|
||||||
|
|
||||||
|
// many-to-many from table "keyword" through table "idea_keyword"
|
||||||
@ManyToMany
|
@ManyToMany
|
||||||
@JoinTable(name="idea_keyword",
|
@JoinTable(name="idea_keyword",
|
||||||
joinColumns = @JoinColumn(name = "idea_id", referencedColumnName = "id"),
|
joinColumns = @JoinColumn(name = "idea_id", referencedColumnName = "id"),
|
||||||
inverseJoinColumns = @JoinColumn(name = "keyword_id", referencedColumnName = "id"))
|
inverseJoinColumns = @JoinColumn(name = "keyword_id", referencedColumnName = "id"))
|
||||||
private Set<Keyword> keywords = new HashSet<>();
|
private Set<Keyword> keywords = new HashSet<>();
|
||||||
|
|
||||||
@OneToOne
|
// ----------------------------------------------------------------------------------
|
||||||
private Project project;
|
// JPA-mappings of other tables referencing this table "idea"
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
|
|
||||||
@OneToOne(mappedBy = "idea", orphanRemoval = true, optional = true)
|
// from table idea_language
|
||||||
private FirstMeeting firstMeeting;
|
@ElementCollection
|
||||||
|
@CollectionTable(name = "idea_language",
|
||||||
|
joinColumns = @JoinColumn(name = "idea_id", referencedColumnName = "id"))
|
||||||
|
@Column(name = "language")
|
||||||
|
@Enumerated(EnumType.STRING)
|
||||||
|
private Set<Language> languages = EnumSet.noneOf(Language.class);
|
||||||
|
|
||||||
|
// from table idea_export
|
||||||
|
@OneToMany(mappedBy = "idea", cascade = CascadeType.ALL)
|
||||||
|
private List<IdeaExport> exports = new ArrayList<>();
|
||||||
|
|
||||||
|
// from table idea_student
|
||||||
|
@OneToMany(fetch = FetchType.LAZY, mappedBy = "idea", cascade = CascadeType.ALL, orphanRemoval = true)
|
||||||
|
@QueryInit({"user", "program"})
|
||||||
|
private Set<IdeaParticipation> ideaParticipations = new HashSet<>();
|
||||||
|
|
||||||
|
// from table "idea_match"
|
||||||
@OneToMany(fetch = FetchType.LAZY, mappedBy = "idea", cascade = CascadeType.ALL)
|
@OneToMany(fetch = FetchType.LAZY, mappedBy = "idea", cascade = CascadeType.ALL)
|
||||||
@OrderBy("dateCreated DESC")
|
@OrderBy("dateCreated DESC")
|
||||||
private List<Match> matchHistory = new ArrayList<>();
|
private List<Match> matchHistory = new ArrayList<>();
|
||||||
|
|
||||||
@OneToOne(optional = true, cascade = CascadeType.ALL)
|
// from table "idea_first_meeting"
|
||||||
@QueryInit({"supervisor.user", "supervisor.unit"})
|
@OneToOne(mappedBy = "idea", orphanRemoval = true, optional = true)
|
||||||
private Match match;
|
private FirstMeeting firstMeeting;
|
||||||
|
|
||||||
@Column(name = "published")
|
|
||||||
private boolean published = true;
|
|
||||||
|
|
||||||
@OneToMany(mappedBy = "idea", cascade = CascadeType.ALL)
|
|
||||||
private List<IdeaExport> exports = new ArrayList<>();
|
|
||||||
|
|
||||||
@Enumerated(EnumType.STRING)
|
|
||||||
private Status cachedStatus;
|
|
||||||
|
|
||||||
@Basic
|
|
||||||
private boolean inactive = false;
|
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
|
// methods...
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
public Idea copy(User supervisor) {
|
public Idea copy(User supervisor) {
|
||||||
Idea copy = new Idea();
|
Idea copy = new Idea();
|
||||||
copy.projectType = this.projectType;
|
copy.projectType = this.projectType;
|
||||||
@ -490,7 +531,9 @@ public class Idea extends DomainObject {
|
|||||||
public String toString() {
|
public String toString() {
|
||||||
return "Student idea";
|
return "Student idea";
|
||||||
}
|
}
|
||||||
}, SUPERVISOR {
|
},
|
||||||
|
|
||||||
|
SUPERVISOR {
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "Supervisor idea";
|
return "Supervisor idea";
|
||||||
@ -505,18 +548,21 @@ public class Idea extends DomainObject {
|
|||||||
return "Unmatched";
|
return "Unmatched";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
MATCHED {
|
MATCHED {
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "Matched, no project";
|
return "Matched, no project";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
COMPLETED {
|
COMPLETED {
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "Matched, has project";
|
return "Matched, has project";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
INACTIVE {
|
INACTIVE {
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
@ -1,8 +1,18 @@
|
|||||||
package se.su.dsv.scipro.match;
|
package se.su.dsv.scipro.match;
|
||||||
|
|
||||||
|
import jakarta.persistence.Basic;
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.EnumType;
|
||||||
|
import jakarta.persistence.Enumerated;
|
||||||
|
import jakarta.persistence.GeneratedValue;
|
||||||
|
import jakarta.persistence.GenerationType;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
import jakarta.persistence.JoinColumn;
|
||||||
|
import jakarta.persistence.ManyToOne;
|
||||||
|
import jakarta.persistence.Table;
|
||||||
|
|
||||||
import se.su.dsv.scipro.system.DomainObject;
|
import se.su.dsv.scipro.system.DomainObject;
|
||||||
|
|
||||||
import jakarta.persistence.*;
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@ -11,56 +21,69 @@ public class IdeaExport extends DomainObject {
|
|||||||
|
|
||||||
public enum Result { FAIL, SUCCESS }
|
public enum Result { FAIL, SUCCESS }
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
|
// basic and embedded JPA-mappings
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
@Enumerated(EnumType.STRING)
|
|
||||||
private Result result;
|
|
||||||
|
|
||||||
@Basic
|
@Basic
|
||||||
private String reason;
|
private String reason;
|
||||||
|
|
||||||
|
@Enumerated(EnumType.STRING)
|
||||||
|
private Result result;
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
|
// JPA-mappings of foreign keys in this table (idea_export) referencing other tables
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
@ManyToOne(optional = false)
|
@ManyToOne(optional = false)
|
||||||
|
@JoinColumn(name = "idea_id", referencedColumnName = "id")
|
||||||
private Idea idea;
|
private Idea idea;
|
||||||
|
|
||||||
public boolean wasSuccessful() {
|
// ----------------------------------------------------------------------------------
|
||||||
return result == Result.SUCCESS;
|
// getters and setters
|
||||||
}
|
// ----------------------------------------------------------------------------------
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return this.id;
|
return this.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Result getResult() {
|
|
||||||
return this.result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getReason() {
|
|
||||||
return this.reason;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Idea getIdea() {
|
|
||||||
return this.idea;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(Long id) {
|
public void setId(Long id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setResult(Result result) {
|
public String getReason() {
|
||||||
this.result = result;
|
return this.reason;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setReason(String reason) {
|
public void setReason(String reason) {
|
||||||
this.reason = reason;
|
this.reason = reason;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Result getResult() {
|
||||||
|
return this.result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setResult(Result result) {
|
||||||
|
this.result = result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Idea getIdea() {
|
||||||
|
return this.idea;
|
||||||
|
}
|
||||||
|
|
||||||
public void setIdea(Idea idea) {
|
public void setIdea(Idea idea) {
|
||||||
this.idea = idea;
|
this.idea = idea;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
|
// other methods
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
|
public boolean wasSuccessful() {
|
||||||
|
return result == Result.SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(final Object o) {
|
public boolean equals(final Object o) {
|
||||||
if (o == this) return true;
|
if (o == this) return true;
|
||||||
|
@ -1,83 +1,115 @@
|
|||||||
package se.su.dsv.scipro.match;
|
package se.su.dsv.scipro.match;
|
||||||
|
|
||||||
|
import jakarta.persistence.AssociationOverride;
|
||||||
|
import jakarta.persistence.AssociationOverrides;
|
||||||
|
import jakarta.persistence.Basic;
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.GeneratedValue;
|
||||||
|
import jakarta.persistence.GenerationType;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
import jakarta.persistence.JoinColumn;
|
||||||
|
import jakarta.persistence.ManyToOne;
|
||||||
|
import jakarta.persistence.Table;
|
||||||
|
|
||||||
import se.su.dsv.scipro.system.Program;
|
import se.su.dsv.scipro.system.Program;
|
||||||
import se.su.dsv.scipro.system.User;
|
import se.su.dsv.scipro.system.User;
|
||||||
|
|
||||||
import jakarta.persistence.*;
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "idea_student")
|
@Table(name = "idea_student")
|
||||||
@AssociationOverrides({
|
|
||||||
@AssociationOverride(name = "idea",
|
|
||||||
joinColumns = @JoinColumn(name = "idea_id")) })
|
|
||||||
public class IdeaParticipation implements Serializable {
|
public class IdeaParticipation implements Serializable {
|
||||||
protected IdeaParticipation() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public IdeaParticipation(User student, Idea idea) {
|
|
||||||
this.user = student;
|
|
||||||
this.idea = idea;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
|
// basic and embedded JPA-mappings
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
@ManyToOne
|
@Basic
|
||||||
private User user;
|
|
||||||
|
|
||||||
@ManyToOne
|
|
||||||
private Idea idea;
|
|
||||||
|
|
||||||
private Date dateCreated = new Date();
|
private Date dateCreated = new Date();
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
|
// JPA-mappings of foreign keys in this table (idea_student) referencing other tables.
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
|
@ManyToOne
|
||||||
|
@JoinColumn(name = "idea_id", referencedColumnName = "id")
|
||||||
|
private Idea idea;
|
||||||
|
|
||||||
@ManyToOne(optional = true)
|
@ManyToOne(optional = true)
|
||||||
|
@JoinColumn(name = "program_id", referencedColumnName = "id")
|
||||||
private Program program;
|
private Program program;
|
||||||
|
|
||||||
|
@ManyToOne
|
||||||
|
@JoinColumn(name = "user_id", referencedColumnName = "id")
|
||||||
|
private User user;
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
|
// Constructors
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// JPA/Hibernate works by create a child class of your entity class with all database
|
||||||
|
// tricks in it, it therefore requires no-arg constructor to be able to instantiate
|
||||||
|
// a new instance.
|
||||||
|
// By creating a protected constructor, JPA/Hibernate still works as expected, but it
|
||||||
|
// declares the intention that parameters need to be provided when new instances are
|
||||||
|
// created.
|
||||||
|
protected IdeaParticipation() { }
|
||||||
|
|
||||||
|
public IdeaParticipation(User student, Idea idea) {
|
||||||
|
this.user = student;
|
||||||
|
this.idea = idea;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// getters and setters
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return this.id;
|
return this.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public User getUser() {
|
|
||||||
return this.user;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Idea getIdea() {
|
|
||||||
return this.idea;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getDateCreated() {
|
|
||||||
return this.dateCreated;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Program getProgram() {
|
|
||||||
return this.program;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(Long id) {
|
public void setId(Long id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUser(User user) {
|
public Date getDateCreated() {
|
||||||
this.user = user;
|
return this.dateCreated;
|
||||||
}
|
|
||||||
|
|
||||||
public void setIdea(Idea idea) {
|
|
||||||
this.idea = idea;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDateCreated(Date dateCreated) {
|
public void setDateCreated(Date dateCreated) {
|
||||||
this.dateCreated = dateCreated;
|
this.dateCreated = dateCreated;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Idea getIdea() {
|
||||||
|
return this.idea;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIdea(Idea idea) {
|
||||||
|
this.idea = idea;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Program getProgram() {
|
||||||
|
return this.program;
|
||||||
|
}
|
||||||
|
|
||||||
public void setProgram(Program program) {
|
public void setProgram(Program program) {
|
||||||
this.program = program;
|
this.program = program;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public User getUser() {
|
||||||
|
return this.user;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUser(User user) {
|
||||||
|
this.user = user;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// methods
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "IdeaParticipation(id=" + this.getId() + ", user=" + this.getUser() + ", idea=" + this.getIdea() + ", dateCreated=" + this.getDateCreated() + ", program=" + this.getProgram() + ")";
|
return "IdeaParticipation(id=" + this.getId() + ", user=" + this.getUser() + ", idea=" + this.getIdea() + ", dateCreated=" + this.getDateCreated() + ", program=" + this.getProgram() + ")";
|
||||||
|
@ -1,56 +1,85 @@
|
|||||||
package se.su.dsv.scipro.match;
|
package se.su.dsv.scipro.match;
|
||||||
|
|
||||||
import com.querydsl.core.annotations.QueryInit;
|
import com.querydsl.core.annotations.QueryInit;
|
||||||
|
import jakarta.persistence.Basic;
|
||||||
|
import jakarta.persistence.Cacheable;
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.EnumType;
|
||||||
|
import jakarta.persistence.Enumerated;
|
||||||
|
import jakarta.persistence.GeneratedValue;
|
||||||
|
import jakarta.persistence.GenerationType;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
import jakarta.persistence.JoinColumn;
|
||||||
|
import jakarta.persistence.ManyToOne;
|
||||||
|
import jakarta.persistence.Table;
|
||||||
|
|
||||||
import se.su.dsv.scipro.system.DomainObject;
|
import se.su.dsv.scipro.system.DomainObject;
|
||||||
import se.su.dsv.scipro.system.User;
|
import se.su.dsv.scipro.system.User;
|
||||||
|
|
||||||
import jakarta.persistence.*;
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Cacheable(true)
|
|
||||||
@Table(name = "idea_match")
|
@Table(name = "idea_match")
|
||||||
|
@Cacheable(true)
|
||||||
public class Match extends DomainObject {
|
public class Match extends DomainObject {
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
|
// basic JPA-mappings
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
@ManyToOne(optional = false)
|
@Basic
|
||||||
private Idea idea;
|
|
||||||
|
|
||||||
@ManyToOne
|
|
||||||
@QueryInit({"unit"})
|
|
||||||
private User supervisor;
|
|
||||||
|
|
||||||
@Enumerated(EnumType.STRING)
|
@Enumerated(EnumType.STRING)
|
||||||
private Idea.Status status;
|
private Idea.Status status;
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
|
// JPA-mappings of foreign keys in this table (idea_match) referencing other tables.
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
@ManyToOne(optional = true)
|
@ManyToOne(optional = true)
|
||||||
|
@JoinColumn(name = "changed_by_user_id", referencedColumnName = "id")
|
||||||
private User changedBy;
|
private User changedBy;
|
||||||
|
|
||||||
public User getSupervisor() {
|
@ManyToOne(optional = false)
|
||||||
return supervisor;
|
@JoinColumn(name = "idea_id", referencedColumnName = "id")
|
||||||
}
|
private Idea idea;
|
||||||
|
|
||||||
|
@ManyToOne
|
||||||
|
@JoinColumn(name = "supervisor_user_id", referencedColumnName = "id")
|
||||||
|
@QueryInit({"unit"})
|
||||||
|
private User supervisor;
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
|
// getters and setters
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
@Override
|
@Override
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return this.id;
|
return this.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Idea getIdea() {
|
public void setId(Long id) {
|
||||||
return this.idea;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Idea.Status getStatus() {
|
public Idea.Status getStatus() {
|
||||||
return this.status;
|
return this.status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setStatus(Idea.Status status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
public User getChangedBy() {
|
public User getChangedBy() {
|
||||||
return this.changedBy;
|
return this.changedBy;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setId(Long id) {
|
public void setChangedBy(User changedBy) {
|
||||||
this.id = id;
|
this.changedBy = changedBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Idea getIdea() {
|
||||||
|
return this.idea;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIdea(Idea idea) {
|
public void setIdea(Idea idea) {
|
||||||
@ -61,14 +90,13 @@ public class Match extends DomainObject {
|
|||||||
this.supervisor = supervisor;
|
this.supervisor = supervisor;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStatus(Idea.Status status) {
|
public User getSupervisor() {
|
||||||
this.status = status;
|
return supervisor;
|
||||||
}
|
|
||||||
|
|
||||||
public void setChangedBy(User changedBy) {
|
|
||||||
this.changedBy = changedBy;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
|
// other methods
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(final Object o) {
|
public boolean equals(final Object o) {
|
||||||
if (o == this) return true;
|
if (o == this) return true;
|
||||||
@ -93,6 +121,7 @@ public class Match extends DomainObject {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "Match(id=" + this.getId() + ", supervisor=" + this.getSupervisor() + ", status=" + this.getStatus() + ", changedBy=" + this.getChangedBy() + ")";
|
return "Match(id=" + this.getId() + ", supervisor=" + this.getSupervisor() + ", status=" + this.getStatus() +
|
||||||
|
", changedBy=" + this.getChangedBy() + ")";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,70 +1,98 @@
|
|||||||
package se.su.dsv.scipro.match;
|
package se.su.dsv.scipro.match;
|
||||||
|
|
||||||
|
import jakarta.persistence.Basic;
|
||||||
|
import jakarta.persistence.Column;
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.GeneratedValue;
|
||||||
|
import jakarta.persistence.GenerationType;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
import jakarta.persistence.JoinColumn;
|
||||||
|
import jakarta.persistence.ManyToOne;
|
||||||
|
import jakarta.persistence.Table;
|
||||||
|
|
||||||
import se.su.dsv.scipro.system.DomainObject;
|
import se.su.dsv.scipro.system.DomainObject;
|
||||||
import se.su.dsv.scipro.system.User;
|
import se.su.dsv.scipro.system.User;
|
||||||
|
|
||||||
import jakarta.persistence.*;
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "preliminary_match")
|
@Table(name = "preliminary_match")
|
||||||
public class PreliminaryMatch extends DomainObject {
|
public class PreliminaryMatch extends DomainObject {
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
|
// basic JPA-mappings
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
@Basic
|
||||||
|
@Column(name = "comment")
|
||||||
|
private String comment;
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
|
// JPA-mappings of foreign keys in this table (idea_first_meeting) referencing other
|
||||||
|
// tables.
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
|
@JoinColumn(name = "idea_id", referencedColumnName = "id")
|
||||||
private Idea idea;
|
private Idea idea;
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
|
@JoinColumn(name = "supervisor_user_id", referencedColumnName = "id")
|
||||||
private User supervisor;
|
private User supervisor;
|
||||||
|
|
||||||
private String comment;
|
// ----------------------------------------------------------------------------------
|
||||||
|
// constructors
|
||||||
// JPA
|
// ----------------------------------------------------------------------------------
|
||||||
public PreliminaryMatch() {
|
public PreliminaryMatch() { }
|
||||||
}
|
|
||||||
|
|
||||||
public PreliminaryMatch(final Idea idea) {
|
public PreliminaryMatch(final Idea idea) {
|
||||||
this.idea = idea;
|
this.idea = idea;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
|
// getters and setters
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
@Override
|
@Override
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return this.id;
|
return this.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Idea getIdea() {
|
|
||||||
return this.idea;
|
|
||||||
}
|
|
||||||
|
|
||||||
public User getSupervisor() {
|
|
||||||
return this.supervisor;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getComment() {
|
|
||||||
return this.comment;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(Long id) {
|
public void setId(Long id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIdea(Idea idea) {
|
public String getComment() {
|
||||||
this.idea = idea;
|
return this.comment;
|
||||||
}
|
|
||||||
|
|
||||||
public void setSupervisor(User supervisor) {
|
|
||||||
this.supervisor = supervisor;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setComment(String comment) {
|
public void setComment(String comment) {
|
||||||
this.comment = comment;
|
this.comment = comment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Idea getIdea() {
|
||||||
|
return this.idea;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIdea(Idea idea) {
|
||||||
|
this.idea = idea;
|
||||||
|
}
|
||||||
|
|
||||||
|
public User getSupervisor() {
|
||||||
|
return this.supervisor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSupervisor(User supervisor) {
|
||||||
|
this.supervisor = supervisor;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
|
// other methods
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "PreliminaryMatch(id=" + this.getId() + ", idea=" + this.getIdea() + ", supervisor=" + this.getSupervisor() + ", comment=" + this.getComment() + ")";
|
return "PreliminaryMatch(id=" + this.getId() + ", idea=" + this.getIdea() + ", supervisor=" +
|
||||||
|
this.getSupervisor() + ", comment=" + this.getComment() + ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -26,7 +26,13 @@ import jakarta.persistence.Table;
|
|||||||
|
|
||||||
import se.su.dsv.scipro.data.dataobjects.Member;
|
import se.su.dsv.scipro.data.dataobjects.Member;
|
||||||
import se.su.dsv.scipro.reusable.SciProUtilities;
|
import se.su.dsv.scipro.reusable.SciProUtilities;
|
||||||
import se.su.dsv.scipro.system.*;
|
import se.su.dsv.scipro.system.DegreeType;
|
||||||
|
import se.su.dsv.scipro.system.DomainObject;
|
||||||
|
import se.su.dsv.scipro.system.Language;
|
||||||
|
import se.su.dsv.scipro.system.ProjectModule;
|
||||||
|
import se.su.dsv.scipro.system.ProjectType;
|
||||||
|
import se.su.dsv.scipro.system.ResearchArea;
|
||||||
|
import se.su.dsv.scipro.system.User;
|
||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -1599,11 +1599,160 @@ alter table `keyword_research_area`
|
|||||||
foreign key (research_area_id) references research_area (id)
|
foreign key (research_area_id) references research_area (id)
|
||||||
on delete cascade on update cascade;
|
on delete cascade on update cascade;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Step 10: idea related tables
|
||||||
|
*/
|
||||||
|
|
||||||
|
-- table: idea
|
||||||
|
|
||||||
|
alter table `idea` drop foreign key `FK6E051897B9431B73`;
|
||||||
|
alter table `idea` drop foreign key `FK6E051897C1813915`;
|
||||||
|
alter table `idea` drop foreign key `FK6E051897E44F4DBE`;
|
||||||
|
|
||||||
|
alter table `idea` drop key `FK6E051897C1813915`;
|
||||||
|
alter table `idea` drop key `FK6E051897B9431B73`;
|
||||||
|
alter table `idea` drop key `FK6E051897E44F4DBE`;
|
||||||
|
|
||||||
|
alter table `idea` change `published` `published` bit(1) not null default b'1' after `type`;
|
||||||
|
alter table `idea` change `cachedStatus` `cached_status` varchar(255) default null after `published`;
|
||||||
|
alter table `idea` change `inactive` `inactive` tinyint(1) not null default 0 after `cached_status`;
|
||||||
|
|
||||||
|
alter table `idea` change `practicalHow` `practical_how` longtext default null after `inactive`;
|
||||||
|
alter table `idea` change `theoryHow` `theory_how` longtext default null after `practical_how`;
|
||||||
|
alter table `idea` change `literature` `literature` longtext default null after `why`;
|
||||||
|
|
||||||
|
alter table `idea` change `background` `background` longtext default null after `literature`;
|
||||||
|
alter table `idea` change `problem` `problem` longtext default null after `background`;
|
||||||
|
alter table `idea` change `method` `method` longtext default null after `problem`;
|
||||||
|
alter table `idea` change `interests` `interests` longtext default null after `method`;
|
||||||
|
|
||||||
|
alter table `idea` rename column `creator_id` to `creator_user_id`;
|
||||||
|
alter table `idea` rename column `match_id` to `latest_match_id`;
|
||||||
|
|
||||||
|
alter table `idea`
|
||||||
|
add constraint fk_idea_creator_user_id
|
||||||
|
foreign key (creator_user_id) references user (id)
|
||||||
|
on delete cascade on update cascade;
|
||||||
|
|
||||||
|
alter table `idea`
|
||||||
|
add constraint fk_idea_latest_match_id
|
||||||
|
foreign key (latest_match_id) references idea_match (id)
|
||||||
|
on delete cascade on update cascade;
|
||||||
|
|
||||||
|
alter table `idea`
|
||||||
|
add constraint fk_idea_project_id
|
||||||
|
foreign key (project_id) references project (id)
|
||||||
|
on delete cascade on update cascade;
|
||||||
|
|
||||||
|
-- table: idea_language
|
||||||
|
|
||||||
|
alter table `idea_language` drop foreign key `FK_idea_language_idea`;
|
||||||
|
alter table `idea_language` drop key `FK_idea_language_idea`;
|
||||||
|
|
||||||
|
alter table `idea_language`
|
||||||
|
add constraint fk_idea_language_idea_id
|
||||||
|
foreign key (idea_id) references idea (id)
|
||||||
|
on delete cascade on update cascade;
|
||||||
|
|
||||||
|
-- table: idea_export
|
||||||
|
|
||||||
|
alter table `idea_export` drop foreign key `FK68FA705CFCDADF61`;
|
||||||
|
alter table `idea_export` drop key `FK68FA705CFCDADF61`;
|
||||||
|
|
||||||
|
alter table `idea_export`
|
||||||
|
add constraint fk_idea_export_idea_id
|
||||||
|
foreign key (idea_id) references idea (id)
|
||||||
|
on delete cascade on update cascade;
|
||||||
|
|
||||||
|
-- table: idea_first_meeting
|
||||||
|
|
||||||
|
alter table `idea_first_meeting` drop foreign key `FK9393AA04FCDADF61`;
|
||||||
|
alter table `idea_first_meeting` drop key `FK9393AA04FCDADF61`;
|
||||||
|
|
||||||
|
alter table `idea_first_meeting` drop key `UK_k4m4tupnikallbq3cq3llvlmk`;
|
||||||
|
alter table `idea_first_meeting` drop key `idea_id`;
|
||||||
|
|
||||||
|
alter table `idea_first_meeting` rename column `firstMeetingDate` to `first_meeting_date`;
|
||||||
|
alter table `idea_first_meeting` change `room` `room` longtext not null after `first_meeting_date`;
|
||||||
|
|
||||||
|
alter table `idea_first_meeting`
|
||||||
|
add constraint fk_idea_first_meeting_idea_id
|
||||||
|
foreign key (idea_id) references idea (id)
|
||||||
|
on delete cascade on update cascade;
|
||||||
|
|
||||||
|
alter table `idea_first_meeting`
|
||||||
|
add constraint uk_idea_first_meeting_idea_id unique(idea_id);
|
||||||
|
|
||||||
|
-- table: idea_match
|
||||||
|
|
||||||
|
alter table `idea_match` drop foreign key `FK87EA481DFCDADF61`;
|
||||||
|
alter table `idea_match` drop foreign key `FK87EA481DA89FFB7F`;
|
||||||
|
alter table `idea_match` drop foreign key `idea_match_supervisor_id`;
|
||||||
|
|
||||||
|
alter table `idea_match` drop key `FK87EA481DFCDADF61`;
|
||||||
|
alter table `idea_match` drop key `FK87EA481DA89FFB7F`;
|
||||||
|
alter table `idea_match` drop key `idea_match_supervisor_id`;
|
||||||
|
|
||||||
|
alter table `idea_match` rename column `changedBy_id` to `changed_by_user_id`;
|
||||||
|
alter table `idea_match` rename column `supervisor_id` to `supervisor_user_id`;
|
||||||
|
|
||||||
|
alter table `idea_match`
|
||||||
|
add constraint fk_idea_match_idea_id
|
||||||
|
foreign key (idea_id) references idea (id)
|
||||||
|
on delete cascade on update cascade;
|
||||||
|
|
||||||
|
alter table `idea_match`
|
||||||
|
add constraint fk_idea_match_changed_by_user_id
|
||||||
|
foreign key (changed_by_user_id) references user (id)
|
||||||
|
on delete cascade on update cascade;
|
||||||
|
|
||||||
|
alter table `idea_match`
|
||||||
|
add constraint fk_idea_match_supervisor_user_id
|
||||||
|
foreign key (supervisor_user_id) references user (id)
|
||||||
|
on delete cascade on update cascade;
|
||||||
|
|
||||||
|
-- table: preliminary_match
|
||||||
|
|
||||||
|
alter table `preliminary_match` drop foreign key `FK_preliminary_match_supervisor`;
|
||||||
|
alter table `preliminary_match` drop foreign key `FK_preliminary_match_idea`;
|
||||||
|
|
||||||
|
alter table `preliminary_match` drop key `FK_preliminary_match_supervisor`;
|
||||||
|
alter table `preliminary_match` drop key `FK_preliminary_match_idea`;
|
||||||
|
|
||||||
|
alter table `preliminary_match` change `comment` `comment` mediumtext default null after `version`;
|
||||||
|
alter table `preliminary_match` rename column `supervisor_id` to `supervisor_user_id`;
|
||||||
|
|
||||||
|
alter table `preliminary_match`
|
||||||
|
add constraint fk_preliminary_match_idea_id
|
||||||
|
foreign key (idea_id) references idea (id)
|
||||||
|
on delete cascade on update cascade;
|
||||||
|
|
||||||
|
alter table `preliminary_match`
|
||||||
|
add constraint fk_preliminary_match_supervisor_user_id
|
||||||
|
foreign key (supervisor_user_id) references user (id)
|
||||||
|
on delete cascade on update cascade;
|
||||||
|
|
||||||
|
-- table: idea_student
|
||||||
|
|
||||||
|
alter table `idea_student` drop foreign key `idea_student_user_id`;
|
||||||
|
alter table `idea_student` drop foreign key `FK9458BA93FCDADF61`;
|
||||||
|
|
||||||
|
alter table `idea_student` drop key `idea_student_user_id`;
|
||||||
|
alter table `idea_student` drop key `FK9458BA93FCDADF61`;
|
||||||
|
alter table `idea_student` drop key `FK_c5py593l4g261jdkuvwdmcmgj`;
|
||||||
|
|
||||||
|
alter table `idea_student` rename column `dateCreated` to `date_created`;
|
||||||
|
alter table `idea_student` change `id` `id` bigint(20) not null auto_increment first;
|
||||||
|
|
||||||
|
alter table `idea_student`
|
||||||
|
add constraint fk_idea_student_idea_id
|
||||||
|
foreign key (idea_id) references idea (id)
|
||||||
|
on delete cascade on update cascade;
|
||||||
|
|
||||||
|
alter table `idea_student`
|
||||||
|
add constraint fk_idea_student_user_id
|
||||||
|
foreign key (user_id) references user (id)
|
||||||
|
on delete cascade on update cascade;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user