Index: eprms-model/pom.xml
===================================================================
--- eprms-model/pom.xml	(revision e6185874fd4ef07cc958e3671526af74481ac119)
+++ eprms-model/pom.xml	(revision 272178e3df8afdaceb366fa8f11ff27bd2dd5c4d)
@@ -6,5 +6,5 @@
 	<groupId>info.ajanovski.eprms</groupId>
 	<artifactId>model</artifactId>
-	<version>0.0.7-SNAPSHOT</version>
+	<version>0.0.8-SNAPSHOT</version>
 
 	<name>EPRMS - Educational Project and Resource Management System - Model</name>
Index: eprms-model/src/main/java/info/ajanovski/eprms/model/entities/DiscussionOnCourseProject.java
===================================================================
--- eprms-model/src/main/java/info/ajanovski/eprms/model/entities/DiscussionOnCourseProject.java	(revision 272178e3df8afdaceb366fa8f11ff27bd2dd5c4d)
+++ eprms-model/src/main/java/info/ajanovski/eprms/model/entities/DiscussionOnCourseProject.java	(revision 272178e3df8afdaceb366fa8f11ff27bd2dd5c4d)
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (C) 2021 Vangel V. Ajanovski
+ *     
+ * This file is part of the EPRMS - Educational Project and Resource Management 
+ * System (hereinafter: EPRMS).
+ *     
+ * EPRMS 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.
+ *     
+ * EPRMS 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 EPRMS.  If not, see <https://www.gnu.org/licenses/>.
+ * 
+ ******************************************************************************/
+
+package info.ajanovski.eprms.model.entities;
+
+import java.util.*;
+import javax.persistence.*;
+import javax.validation.constraints.*;
+
+/*
+Denotes which CourseProjects are open for discussions in the selected DiscussionSession
+*/
+@Entity
+@Table (schema="epm_main", name="discussion_on_course_project")
+public class DiscussionOnCourseProject implements java.io.Serializable {
+	private long discussionOnCourseProjectId;
+	private DiscussionSession discussionSession;
+	private CourseProject courseProject;
+	private List<DiscussionPost> discussionPosts = new ArrayList<DiscussionPost>();
+
+
+	@Id
+	@GeneratedValue(strategy = GenerationType.IDENTITY)
+
+	@NotNull
+	@Column(name = "discussion_on_course_project_id", unique = true, nullable = false)
+	public long getDiscussionOnCourseProjectId() {
+		return this.discussionOnCourseProjectId;
+	}
+
+	public void setDiscussionOnCourseProjectId(long discussionOnCourseProjectId) {
+		this.discussionOnCourseProjectId=discussionOnCourseProjectId;
+	}
+
+	@ManyToOne(fetch = FetchType.LAZY)
+	@JoinColumn(name = "discussion_session_id", nullable = false, foreignKey = @ForeignKey(name = "fk_discussion_on_course_project_discussion_session"))
+	public DiscussionSession getDiscussionSession() {
+		return this.discussionSession;
+	}
+
+	public void setDiscussionSession(DiscussionSession discussionSession) {
+		this.discussionSession=discussionSession;
+	}
+
+	@ManyToOne(fetch = FetchType.LAZY)
+	@JoinColumn(name = "course_project_id", nullable = true, foreignKey = @ForeignKey(name = "fk_discussion_on_course_project_course_project"))
+	public CourseProject getCourseProject() {
+		return this.courseProject;
+	}
+
+	public void setCourseProject(CourseProject courseProject) {
+		this.courseProject=courseProject;
+	}
+
+	@OneToMany(fetch = FetchType.LAZY, mappedBy = "discussionOnCourseProject")
+	public List<DiscussionPost> getDiscussionPosts() {
+		return this.discussionPosts;
+	}
+
+	public void setDiscussionPosts(List<DiscussionPost> discussionPosts) {
+		this.discussionPosts=discussionPosts;
+	}
+
+}
Index: eprms-model/src/main/java/info/ajanovski/eprms/model/entities/DiscussionPost.java
===================================================================
--- eprms-model/src/main/java/info/ajanovski/eprms/model/entities/DiscussionPost.java	(revision 272178e3df8afdaceb366fa8f11ff27bd2dd5c4d)
+++ eprms-model/src/main/java/info/ajanovski/eprms/model/entities/DiscussionPost.java	(revision 272178e3df8afdaceb366fa8f11ff27bd2dd5c4d)
@@ -0,0 +1,135 @@
+/*******************************************************************************
+ * Copyright (C) 2021 Vangel V. Ajanovski
+ *     
+ * This file is part of the EPRMS - Educational Project and Resource Management 
+ * System (hereinafter: EPRMS).
+ *     
+ * EPRMS 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.
+ *     
+ * EPRMS 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 EPRMS.  If not, see <https://www.gnu.org/licenses/>.
+ * 
+ ******************************************************************************/
+
+package info.ajanovski.eprms.model.entities;
+
+import java.util.*;
+import javax.persistence.*;
+import javax.validation.constraints.*;
+
+/*
+*/
+@Entity
+@Table (schema="epm_main", name="discussion_post")
+public class DiscussionPost implements java.io.Serializable {
+	private long discussionPostId;
+	private String type;
+	private String message;
+	private Date postedOn;
+	private boolean publicPosting;
+	private List<DiscussionPost> replies = new ArrayList<DiscussionPost>();
+	private DiscussionPost replyTo;
+	private DiscussionOnCourseProject discussionOnCourseProject;
+	private Person person;
+
+
+	@Id
+	@GeneratedValue(strategy = GenerationType.IDENTITY)
+
+	@NotNull
+	@Column(name = "discussion_post_id", unique = true, nullable = false)
+	public long getDiscussionPostId() {
+		return this.discussionPostId;
+	}
+
+	public void setDiscussionPostId(long discussionPostId) {
+		this.discussionPostId=discussionPostId;
+	}
+
+	@Column(name = "type")
+	public String getType() {
+		return this.type;
+	}
+
+	public void setType(String type) {
+		this.type=type;
+	}
+
+	@NotNull
+	@Column(name = "message", nullable = false, length=100000)
+	public String getMessage() {
+		return this.message;
+	}
+
+	public void setMessage(String message) {
+		this.message=message;
+	}
+
+	@NotNull
+	@Column(name = "posted_on", nullable = false)
+	public Date getPostedOn() {
+		return this.postedOn;
+	}
+
+	public void setPostedOn(Date postedOn) {
+		this.postedOn=postedOn;
+	}
+
+	@NotNull
+	@Column(name = "public_posting", nullable = false)
+	public boolean getPublicPosting() {
+		return this.publicPosting;
+	}
+
+	public void setPublicPosting(boolean publicPosting) {
+		this.publicPosting=publicPosting;
+	}
+
+	@OneToMany(fetch = FetchType.LAZY, mappedBy = "replyTo")
+	public List<DiscussionPost> getReplies() {
+		return this.replies;
+	}
+
+	public void setReplies(List<DiscussionPost> replies) {
+		this.replies=replies;
+	}
+
+	@ManyToOne(fetch = FetchType.LAZY)
+	@JoinColumn(name = "reply_to_discussion_post_id", nullable = true, foreignKey = @ForeignKey(name = "fk_discussion_post_discussion_post"))
+	public DiscussionPost getReplyTo() {
+		return this.replyTo;
+	}
+
+	public void setReplyTo(DiscussionPost replyTo) {
+		this.replyTo=replyTo;
+	}
+
+	@ManyToOne(fetch = FetchType.LAZY)
+	@JoinColumn(name = "discussion_on_course_project_id", nullable = false, foreignKey = @ForeignKey(name = "fk_discussion_post_discussion_on_course_project"))
+	public DiscussionOnCourseProject getDiscussionOnCourseProject() {
+		return this.discussionOnCourseProject;
+	}
+
+	public void setDiscussionOnCourseProject(DiscussionOnCourseProject discussionOnCourseProject) {
+		this.discussionOnCourseProject=discussionOnCourseProject;
+	}
+
+	@ManyToOne(fetch = FetchType.LAZY)
+	@JoinColumn(name = "person_id", nullable = false, foreignKey = @ForeignKey(name = "fk_discussion_post_person"))
+	public Person getPerson() {
+		return this.person;
+	}
+
+	public void setPerson(Person person) {
+		this.person=person;
+	}
+
+}
Index: eprms-model/src/main/java/info/ajanovski/eprms/model/entities/DiscussionSession.java
===================================================================
--- eprms-model/src/main/java/info/ajanovski/eprms/model/entities/DiscussionSession.java	(revision 272178e3df8afdaceb366fa8f11ff27bd2dd5c4d)
+++ eprms-model/src/main/java/info/ajanovski/eprms/model/entities/DiscussionSession.java	(revision 272178e3df8afdaceb366fa8f11ff27bd2dd5c4d)
@@ -0,0 +1,103 @@
+/*******************************************************************************
+ * Copyright (C) 2021 Vangel V. Ajanovski
+ *     
+ * This file is part of the EPRMS - Educational Project and Resource Management 
+ * System (hereinafter: EPRMS).
+ *     
+ * EPRMS 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.
+ *     
+ * EPRMS 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 EPRMS.  If not, see <https://www.gnu.org/licenses/>.
+ * 
+ ******************************************************************************/
+
+package info.ajanovski.eprms.model.entities;
+
+import java.util.*;
+import javax.persistence.*;
+import javax.validation.constraints.*;
+
+/*
+*/
+@Entity
+@Table (schema="epm_main", name="discussion_session")
+public class DiscussionSession implements java.io.Serializable {
+	private long discussionSessionId;
+	private Date startDate;
+	private Date endDate;
+	private String title;
+	private List<DiscussionOnCourseProject> discussionsOnCourseProjects = new ArrayList<DiscussionOnCourseProject>();
+	private Course course;
+
+
+	@Id
+	@GeneratedValue(strategy = GenerationType.IDENTITY)
+
+	@NotNull
+	@Column(name = "discussion_session_id", unique = true, nullable = false)
+	public long getDiscussionSessionId() {
+		return this.discussionSessionId;
+	}
+
+	public void setDiscussionSessionId(long discussionSessionId) {
+		this.discussionSessionId=discussionSessionId;
+	}
+
+	@NotNull
+	@Column(name = "start_date", nullable = false)
+	public Date getStartDate() {
+		return this.startDate;
+	}
+
+	public void setStartDate(Date startDate) {
+		this.startDate=startDate;
+	}
+
+	@NotNull
+	@Column(name = "end_date", nullable = false)
+	public Date getEndDate() {
+		return this.endDate;
+	}
+
+	public void setEndDate(Date endDate) {
+		this.endDate=endDate;
+	}
+
+	@NotNull
+	@Column(name = "title", nullable = false)
+	public String getTitle() {
+		return this.title;
+	}
+
+	public void setTitle(String title) {
+		this.title=title;
+	}
+
+	@OneToMany(fetch = FetchType.LAZY, mappedBy = "discussionSession")
+	public List<DiscussionOnCourseProject> getDiscussionsOnCourseProjects() {
+		return this.discussionsOnCourseProjects;
+	}
+
+	public void setDiscussionsOnCourseProjects(List<DiscussionOnCourseProject> discussionsOnCourseProjects) {
+		this.discussionsOnCourseProjects=discussionsOnCourseProjects;
+	}
+
+	@ManyToOne(fetch = FetchType.LAZY)
+	@JoinColumn(name = "course_id", nullable = true, foreignKey = @ForeignKey(name = "fk_discussion_session_course"))
+	public Course getCourse() {
+		return this.course;
+	}
+
+	public void setCourse(Course course) {
+		this.course=course;
+	}
+
+}
Index: eprms-model/src/main/java/info/ajanovski/eprms/model/util/ComparatorDiscussionPostByReplyTo.java
===================================================================
--- eprms-model/src/main/java/info/ajanovski/eprms/model/util/ComparatorDiscussionPostByReplyTo.java	(revision 272178e3df8afdaceb366fa8f11ff27bd2dd5c4d)
+++ eprms-model/src/main/java/info/ajanovski/eprms/model/util/ComparatorDiscussionPostByReplyTo.java	(revision 272178e3df8afdaceb366fa8f11ff27bd2dd5c4d)
@@ -0,0 +1,24 @@
+package info.ajanovski.eprms.model.util;
+
+import java.util.Comparator;
+
+import info.ajanovski.eprms.model.entities.DiscussionPost;
+
+public class ComparatorDiscussionPostByReplyTo implements Comparator<DiscussionPost> {
+
+	public String getCoding(DiscussionPost i) {
+		if (i.getReplyTo() == null) {
+			return Long.toString(i.getPostedOn().getTime()) + "-";
+		} else {
+			return getCoding(i.getReplyTo()) + Long.toString(i.getPostedOn().getTime()) + "-";
+		}
+	}
+
+	@Override
+	public int compare(DiscussionPost o1, DiscussionPost o2) {
+		String hier1 = getCoding(o1);
+		String hier2 = getCoding(o2);
+		return hier1.compareTo(hier2);
+	}
+
+}
Index: eprms-model/src/main/java/info/ajanovski/eprms/model/util/ModelConstants.java
===================================================================
--- eprms-model/src/main/java/info/ajanovski/eprms/model/util/ModelConstants.java	(revision e6185874fd4ef07cc958e3671526af74481ac119)
+++ eprms-model/src/main/java/info/ajanovski/eprms/model/util/ModelConstants.java	(revision 272178e3df8afdaceb366fa8f11ff27bd2dd5c4d)
@@ -75,3 +75,11 @@
 	public static final String[] AllTeamMemberStatuses = { TeamMemberStatusProposed, TeamMemberStatusAccepted,
 			TeamMemberStatusPaused, TeamMemberStatusFinished, TeamMemberStatusQuit };
+
+	public static final String DiscussionPostTypeBug = "BUG";
+	public static final String DiscussionPostTypeImprovement = "IMPROVEMENT";
+	public static final String DiscussionPostTypeTask = "TASK";
+	public static final String DiscussionPostTypeOther = "OTHER";
+	public static final String[] AllDiscussionPostTypes = { DiscussionPostTypeBug, DiscussionPostTypeImprovement,
+			DiscussionPostTypeTask, DiscussionPostTypeOther };
+
 }
