diff --git a/pom.xml b/pom.xml
index b85a456..5b81ded 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,6 +28,11 @@
java-nio-server
0.0.1-SNAPSHOT
+
+ org.hibernate
+ hibernate-core
+ 5.4.10.Final
+
diff --git a/src/main/java/envoy/server/data/Message.java b/src/main/java/envoy/server/data/Message.java
new file mode 100644
index 0000000..be11608
--- /dev/null
+++ b/src/main/java/envoy/server/data/Message.java
@@ -0,0 +1,81 @@
+package envoy.server.data;
+
+import java.util.Date;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+
+import envoy.data.MessageBuilder;
+
+/**
+ * Project: envoy-server-standalone
+ * File: Message.java
+ * Created: 02.01.2020
+ *
+ * @author Kai S. K. Engelbart
+ * @since Envoy Server Standalone v0.1-alpha
+ */
+@Entity
+public class Message {
+
+ @Id
+ private long id;
+ private User sender, recipient;
+ @Temporal(TemporalType.TIMESTAMP)
+ private Date creationDate;
+ @Temporal(TemporalType.TIMESTAMP)
+ private Date receivedDate;
+ @Temporal(TemporalType.TIMESTAMP)
+ private Date readDate;
+ private envoy.data.Message.MessageStatus status;
+ private String text;
+ private byte[] attachment;
+
+ public Message() {}
+
+ // TODO: everything except ID
+ public Message(envoy.data.Message message) { id = message.getId(); }
+
+ public envoy.data.Message toCommonMessage() {
+ // TODO: Attachment, dates
+ return new MessageBuilder(sender.getId(), recipient.getId()).setText(text).setDate(creationDate).setStatus(status).build();
+ }
+
+ public long getId() { return id; }
+
+ public void setId(long id) { this.id = id; }
+
+ public User getSender() { return sender; }
+
+ public void setSender(User sender) { this.sender = sender; }
+
+ public User getRecipient() { return recipient; }
+
+ public void setRecipient(User recipient) { this.recipient = recipient; }
+
+ public Date getCreationDate() { return creationDate; }
+
+ public void setCreationDate(Date creationDate) { this.creationDate = creationDate; }
+
+ public Date getReceivedDate() { return receivedDate; }
+
+ public void setReceivedDate(Date receivedDate) { this.receivedDate = receivedDate; }
+
+ public Date getReadDate() { return readDate; }
+
+ public void setReadDate(Date readDate) { this.readDate = readDate; }
+
+ public envoy.data.Message.MessageStatus getStatus() { return status; }
+
+ public void setStatus(envoy.data.Message.MessageStatus status) { this.status = status; }
+
+ public String getText() { return text; }
+
+ public void setText(String text) { this.text = text; }
+
+ public byte[] getAttachment() { return attachment; }
+
+ public void setAttachment(byte[] attachment) { this.attachment = attachment; }
+}
diff --git a/src/main/java/envoy/server/data/User.java b/src/main/java/envoy/server/data/User.java
new file mode 100644
index 0000000..28dbc0f
--- /dev/null
+++ b/src/main/java/envoy/server/data/User.java
@@ -0,0 +1,57 @@
+package envoy.server.data;
+
+import java.util.Date;
+import java.util.List;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+
+/**
+ * Project: envoy-server-standalone
+ * File: User.java
+ * Created: 02.01.2020
+ *
+ * @author Kai S. K. Engelbart
+ * @since Envoy Server Standalone v0.1-alpha
+ */
+@Entity
+public class User {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private long id;
+ private String name;
+ private byte[] passwordHash;
+ @Temporal(TemporalType.TIMESTAMP)
+ private Date lastSeen;
+ private envoy.data.User.UserStatus status;
+ private List contacts;
+
+ public long getId() { return id; }
+
+ public void setId(long id) { this.id = id; }
+
+ public String getName() { return name; }
+
+ public void setName(String name) { this.name = name; }
+
+ public byte[] getPasswordHash() { return passwordHash; }
+
+ public void setPasswordHash(byte[] passwordHash) { this.passwordHash = passwordHash; }
+
+ public Date getLastSeen() { return lastSeen; }
+
+ public void setLastSeen(Date lastSeen) { this.lastSeen = lastSeen; }
+
+ public envoy.data.User.UserStatus getStatus() { return status; }
+
+ public void setStatus(envoy.data.User.UserStatus status) { this.status = status; }
+
+ public List getContacts() { return contacts; }
+
+ public void setContacts(List contacts) { this.contacts = contacts; }
+}