@@ -0,0 +1,2074 @@
+package entity;%0A%0Aimport java.util.Date;%0A%0Aimport java.io.Serializable;%0A%0Aimport javax.persistence.*;%0A%0A@Entity%0Apublic class Message implements Serializable %7B%0A%0A%09/**%0A%09 * %0A%09 */%0A%09private static final long serialVersionUID = 1L;%0A%0A%09@Id%0A%09@GeneratedValue(strategy = GenerationType.AUTO)%0A%09@Column(name = %22MESSAGE_ID%22)%0A%09private int messageId;%0A%0A%09private String senderName;%0A%09private String receiverName;%0A%0A%09@Temporal(TemporalType.TIMESTAMP)%0A%09private Date sendingDate;%0A%0A%09private String subject;%0A%09private String body;%0A%09private Boolean alreadyRead;%0A%09private Box box;%0A%0A%09public int getmessageId() %7B%0A%09%09return this.messageId;%0A%09%7D%0A%0A%09public Message() %7B%0A%0A%09%7D%0A%0A%09public Message(String senderName, String receiverName, String subject,%0A%09%09%09String body, Box box) %7B%0A%09%09super();%0A%09%09this.senderName = senderName;%0A%09%09this.receiverName = receiverName;%0A%09%09this.sendingDate = new Date();%0A%09%09this.subject = subject;%0A%09%09this.body = body;%0A%09%09this.alreadyRead = false;%0A%09%09this.box = box;%0A%09%7D%0A%0A%09@ManyToOne%0A%09@JoinColumn(name = %22BOX_ID%22, nullable = false)%0A%09public Box getBox() %7B%0A%09%09return box;%0A%09%7D%0A%0A%09public String getsenderName() %7B%0A%09%09return this.senderName;%0A%09%7D%0A%0A%09public String getreceiverName() %7B%0A%09%09return this.receiverName;%0A%09%7D%0A%0A%09public Date getsendingDate() %7B%0A%09%09return this.sendingDate;%0A%09%7D%0A%0A%09public String getsubject() %7B%0A%09%09return this.subject;%0A%09%7D%0A%0A%09public String getbody() %7B%0A%09%09return this.body;%0A%09%7D%0A%0A%09public void setIsRead() %7B%0A%09%09this.alreadyRead = true;%0A%09%7D%0A%0A%09public Boolean getIsRead() %7B%0A%09%09return alreadyRead;%0A%09%7D%0A%0A%09// Methode SET%0A%0A%09public void setsenderName(String senderName) %7B%0A%09%09this.senderName = senderName;%0A%09%7D%0A%0A%09public void setreceiverName(String receiverName) %7B%0A%09%09this.receiverName = receiverName;%0A%09%7D%0A%0A%09public void setsendingDate(Date sendingDate) %7B%0A%09%09this.sendingDate = sendingDate;%0A%09%7D%0A%0A%09public void setsubject(String subject) %7B%0A%09%09this.subject = subject;%0A%09%7D%0A%0A%09public void setbody(String body) %7B%0A%09%09this.body = body;%0A%09%7D%0A%0A%09@Override%0A%09public String toString() %7B%0A%09%09return %22Id :%22 + messageId + %22%5Cn Sent by %22 + senderName%0A%09%09%09%09+  %22%5Cn Received on %22%0A%09%09%09%09+ sendingDate + %22%5Cn Subject : %22 + subject + %22%5Cn Body : %5Cn%22 + body + %22%5Cn%5Cn%22;%0A%09%7D%0A%09%0A%7D%0A

Create Message.java