diff --git a/pic-sure-api-data/pom.xml b/pic-sure-api-data/pom.xml
index e29e6118..55b6eecd 100755
--- a/pic-sure-api-data/pom.xml
+++ b/pic-sure-api-data/pom.xml
@@ -37,5 +37,10 @@
org.hibernate
hibernate-core
+
+ io.swagger.core.v3
+ swagger-annotations
+ 2.2.8
+
diff --git a/pic-sure-api-data/src/main/java/edu/harvard/dbmi/avillach/data/entity/AuthUser.java b/pic-sure-api-data/src/main/java/edu/harvard/dbmi/avillach/data/entity/AuthUser.java
new file mode 100755
index 00000000..629ad310
--- /dev/null
+++ b/pic-sure-api-data/src/main/java/edu/harvard/dbmi/avillach/data/entity/AuthUser.java
@@ -0,0 +1,69 @@
+package edu.harvard.dbmi.avillach.data.entity;
+
+import java.security.Principal;
+
+import javax.json.Json;
+
+/*
+ * This class is used to mirror the User object from the auth DB to maintain schema separation. - nc
+ */
+public class AuthUser extends BaseEntity implements Principal {
+ private String userId;
+
+ private String subject;
+
+ private String roles;
+
+ private String email;
+
+ public String getUserId() {
+ return userId;
+ }
+
+ public AuthUser setUserId(String userId) {
+ this.userId = userId;
+ return this;
+ }
+
+ public String getSubject() {
+ return subject;
+ }
+
+ public AuthUser setSubject(String subject) {
+ this.subject = subject;
+ return this;
+ }
+
+ public String getRoles() {
+ return roles;
+ }
+
+ public AuthUser setRoles(String roles) {
+ this.roles = roles;
+ return this;
+ }
+
+ public String getEmail(){
+ return email;
+ }
+
+ public AuthUser setEmail(String email){
+ this.email = email;
+ return this;
+ }
+
+ @Override // Principal method
+ public String getName() {
+ return getEmail();
+ }
+
+ @Override
+ public String toString() {
+ return Json.createObjectBuilder()
+ .add("userId", userId)
+ .add("subject", subject)
+ .add("email", email)
+ .add("roles", roles)
+ .build().toString();
+ }
+}
diff --git a/pic-sure-api-data/src/main/java/edu/harvard/dbmi/avillach/data/entity/NamedDataset.java b/pic-sure-api-data/src/main/java/edu/harvard/dbmi/avillach/data/entity/NamedDataset.java
new file mode 100644
index 00000000..23c9f762
--- /dev/null
+++ b/pic-sure-api-data/src/main/java/edu/harvard/dbmi/avillach/data/entity/NamedDataset.java
@@ -0,0 +1,101 @@
+package edu.harvard.dbmi.avillach.data.entity;
+
+import java.util.Map;
+
+import javax.json.Json;
+import javax.persistence.Column;
+import javax.persistence.Convert;
+import javax.persistence.Entity;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToOne;
+import javax.persistence.Table;
+import javax.persistence.UniqueConstraint;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+
+import edu.harvard.dbmi.avillach.data.entity.convert.JsonConverter;
+
+@Schema(description = "A NamedDataset object containing query, name, user, and archived status.")
+@Entity(name = "named_dataset")
+@Table(uniqueConstraints = {
+ @UniqueConstraint(name = "unique_queryId_user", columnNames = { "queryId", "user" })
+})
+public class NamedDataset extends BaseEntity {
+ @Schema(description = "The associated Query")
+ @OneToOne
+ @JoinColumn(name = "queryId")
+ private Query query;
+
+ @Schema(description = "The user identifier")
+ @Column(length = 255)
+ private String user;
+
+ @Schema(description = "The name user has assigned to this dataset")
+ @Column(length = 255)
+ private String name;
+
+ @Schema(description = "The archived state")
+ private Boolean archived = false;
+
+ @Schema(description = "A json string object containing override specific values")
+ @Column(length = 8192)
+ @Convert(converter = JsonConverter.class)
+ private Map metadata;
+
+ public NamedDataset setName(String name) {
+ this.name = name;
+ return this;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public NamedDataset setArchived(Boolean archived) {
+ this.archived = archived;
+ return this;
+ }
+
+ public Boolean getArchived() {
+ return archived;
+ }
+
+ public NamedDataset setQuery(Query query) {
+ this.query = query;
+ return this;
+ }
+
+ public Query getQuery(){
+ return query;
+ }
+
+ public NamedDataset setUser(String user) {
+ this.user = user;
+ return this;
+ }
+
+ public String getUser(){
+ return user;
+ }
+
+ public Map getMetadata(){
+ return metadata;
+ }
+
+ public NamedDataset setMetadata(Map metadata){
+ this.metadata = metadata;
+ return this;
+ }
+
+ @Override
+ public String toString() {
+ return Json.createObjectBuilder()
+ .add("uuid", uuid.toString())
+ .add("name", name)
+ .add("archived", archived)
+ .add("queryId", query.getUuid().toString())
+ .add("user", user)
+ .add("metadata", metadata.toString())
+ .build().toString();
+ }
+}
diff --git a/pic-sure-api-data/src/main/java/edu/harvard/dbmi/avillach/data/entity/User.java b/pic-sure-api-data/src/main/java/edu/harvard/dbmi/avillach/data/entity/User.java
deleted file mode 100755
index 3c07c542..00000000
--- a/pic-sure-api-data/src/main/java/edu/harvard/dbmi/avillach/data/entity/User.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package edu.harvard.dbmi.avillach.data.entity;
-
-
-/*
- * This class gets created as part of the pic-sure DB schema, but no objects of this type are ever persisted.
- * Its use is to mirror the User object from the auth DB to maintain schema separation. - nc
- *
- */
-public class User extends BaseEntity {
-
- private String userId;
-
- private String subject;
-
- private String roles;
-
- public String getUserId() {
- return userId;
- }
-
- public User setUserId(String userId) {
- this.userId = userId;
- return this;
- }
-
- public String getSubject() {
- return subject;
- }
-
- public User setSubject(String subject) {
- this.subject = subject;
- return this;
- }
-
- public String getRoles() {
- return roles;
- }
-
- public User setRoles(String roles) {
- this.roles = roles;
- return this;
- }
-}
diff --git a/pic-sure-api-data/src/main/java/edu/harvard/dbmi/avillach/data/entity/convert/JsonConverter.java b/pic-sure-api-data/src/main/java/edu/harvard/dbmi/avillach/data/entity/convert/JsonConverter.java
new file mode 100644
index 00000000..77d7decc
--- /dev/null
+++ b/pic-sure-api-data/src/main/java/edu/harvard/dbmi/avillach/data/entity/convert/JsonConverter.java
@@ -0,0 +1,50 @@
+package edu.harvard.dbmi.avillach.data.entity.convert;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.persistence.AttributeConverter;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+public class JsonConverter implements AttributeConverter