14 package cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface;
18 import java.io.Serializable;
19 import javax.persistence.Basic;
20 import javax.persistence.Column;
21 import javax.persistence.Entity;
22 import javax.persistence.GeneratedValue;
23 import javax.persistence.GenerationType;
24 import javax.persistence.Id;
25 import javax.persistence.JoinColumn;
26 import javax.persistence.NamedQueries;
27 import javax.persistence.NamedQuery;
28 import javax.persistence.OneToOne;
29 import javax.persistence.Table;
40 @Table(name =
"subscribedItem")
42 @NamedQuery(name =
"SubscribedItem.findAll", query =
"SELECT s FROM SubscribedItem s"),
43 @NamedQuery(name =
"SubscribedItem.findById", query =
"SELECT s FROM SubscribedItem s WHERE s.id = :id"),
44 @NamedQuery(name =
"SubscribedItem.findSubscriptions", query =
"SELECT s FROM SubscribedItem s WHERE s.storyScope = :storyScope"),
45 @NamedQuery(name =
"SubscribedItem.findSubscribed", query =
"SELECT s FROM SubscribedItem s WHERE s.polarity = 0 AND s.storyScope = :storyScope"),
46 @NamedQuery(name =
"SubscribedItem.findUnsubscribed", query =
"SELECT s FROM SubscribedItem s WHERE s.polarity = 1 AND s.storyScope = :storyScope")})
50 @GeneratedValue(strategy = GenerationType.IDENTITY)
51 @Basic(optional =
false)
56 @Basic(optional = false)
57 @Column(name = "storyScope")
58 private Integer storyScope;
61 @OneToOne(optional = true)
62 @JoinColumn(name = "annotType", referencedColumnName = "
id")
66 @OneToOne(optional = true)
67 @JoinColumn(name = "user", referencedColumnName = "
id")
71 @Basic(optional = true)
72 @Column(name = "source")
73 private String source;
76 @Basic(optional = false)
77 @Column(name = "polarity")
81 public static final
int SUBSCRIBED = 0;
83 public static final
int UNSUBSCRIBED = 1;
91 public Integer getId() {
119 this.storyScope = id;
128 return annotationType;
137 this.annotationType = type;
173 this.source = source;
191 this.polarity = type;
197 hash += (
id != null ? id.hashCode() : 0);
213 SubscribedItem tested = (SubscribedItem)
object;
214 if ((this.
id == null && tested.
id != null) || (this.id != null && !this.id.equals(tested.id))) {
222 return "cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface.SubscribedItem[id=" +
id +
"]";
void setAnnotationType(AnnotType type)
boolean equals(Object object)
void setStoryScopeId(Integer id)
Class representing type of annotation.
Class representing item of subscripted or unsubscripted sources list.
void setSource(String source)
Integer getStoryScopeId()
AnnotType getAnnotationType()