19 package org.turro.alliance.db.entities;
21 import java.io.Serializable;
22 import java.util.Date;
23 import java.util.HashSet;
25 import java.util.Objects;
27 import javax.json.JsonValue;
28 import javax.persistence.Column;
29 import javax.persistence.ElementCollection;
30 import javax.persistence.EmbeddedId;
31 import javax.persistence.Entity;
32 import javax.persistence.FetchType;
33 import javax.persistence.Lob;
34 import javax.persistence.Temporal;
35 import org.turro.jpa.entity.IDaoEntity;
36 import org.turro.json.IJSONizable;
37 import org.turro.students.entities.Challenge;
48 @Temporal(value = javax.persistence.TemporalType.TIMESTAMP)
49 private java.util.Date creation;
51 @ElementCollection(fetch = FetchType.EAGER)
52 private Set<String> studentIds =
new HashSet<>();
63 this.relation = relation;
71 this.creation = creation;
79 this.studentIds = studentIds;
92 public static Set<AxResponse>
from(
long memberId,
Challenge challenge) {
93 Set<AxResponse> responses =
new HashSet<>();
104 responder.
setText(response.getText());
105 responses.add(responder);
119 return relation.isEmpty();
130 public String
toJson(Map<String, Object> properties) {
131 return toJson(
this, properties);
141 hash = 11 * hash + Objects.hashCode(this.relation);
153 if (getClass() != obj.getClass()) {
157 return Objects.
equals(this.relation, other.relation);
boolean equals(Object obj)
void setStudentIds(Set< String > studentIds)
void setText(String text)
void setRelation(RelationId relation)
static AxResponse fromJson(JsonValue value)
Set< String > getStudentIds()
String toJson(Map< String, Object > properties)
void setCreation(Date creation)
static Set< AxResponse > from(long memberId, Challenge challenge)
void setRelatedMemberId(Long relatedMemberId)
void setMainMemberId(Long mainMemberId)
void setRelatedEntityId(String relatedEntityId)
void setMainEntityId(String mainEntityId)
Set< Response > getResponses()