19 package org.turro.students.entities;
21 import java.util.Date;
22 import java.util.HashSet;
23 import java.util.List;
25 import javax.persistence.Column;
26 import javax.persistence.ElementCollection;
27 import javax.persistence.Entity;
28 import javax.persistence.FetchType;
29 import javax.persistence.GeneratedValue;
30 import javax.persistence.GenerationType;
31 import javax.persistence.Id;
32 import javax.persistence.Lob;
33 import javax.persistence.ManyToOne;
34 import javax.persistence.Temporal;
35 import org.turro.string.Strings;
36 import org.turro.action.Contacts;
37 import org.turro.jpa.entity.IDaoEntity;
38 import org.turro.parser.wiki.WikiCompiler;
39 import org.turro.plugin.contacts.ContactList;
40 import org.turro.plugin.contacts.IContact;
50 @GeneratedValue(strategy=GenerationType.IDENTITY)
51 @Column(name=
"IDENTIFIER")
57 @ElementCollection(fetch = FetchType.EAGER)
58 private Set<String> studentIds =
new HashSet<>();
60 @Temporal(value = javax.persistence.TemporalType.TIMESTAMP)
61 private java.util.Date creation;
69 private String wikiText;
84 this.challenge = challenge;
92 this.studentIds = studentIds;
100 this.creation = creation;
116 this.wikiText = wikiText;
129 return studentIds.isEmpty() || Strings.isBlank(text);
136 studentIds.forEach(idContact -> {
143 if(contact !=
null && contact.
isValid()) {
144 studentIds.add(contact.
getId());
149 if(contact !=
null && contact.
isValid()) {
150 studentIds.remove(contact.
getId());
void setCreation(Date creation)
void setText(String text)
void setWikiText(String wikiText)
void setChallenge(Challenge challenge)
List< IContact > getStudentList()
Set< String > getStudentIds()
void removeStudent(IContact contact)
void addStudent(IContact contact)
void setStudentIds(Set< String > studentIds)