1 19 package org.netbeans.modules.exceptions.entity; 20 21 import java.io.Serializable ; 22 import java.util.Collection ; 23 import javax.persistence.CascadeType; 24 import javax.persistence.Column; 25 import javax.persistence.Entity; 26 import javax.persistence.Id; 27 import javax.persistence.NamedQueries; 28 import javax.persistence.NamedQuery; 29 import javax.persistence.OneToMany; 30 import javax.persistence.OneToOne; 31 import javax.persistence.Table; 32 33 37 @Entity 38 @Table(name = "ISSUE") 39 @NamedQueries({@NamedQuery(name = "Issue.findById", query = "SELECT i FROM Issue i WHERE i.id = :id"), 40 @NamedQuery(name = "Issue.findBySummary", query = "SELECT i FROM Issue i WHERE i.summary = :summary"), 41 @NamedQuery(name = "Issue.findByVm", query = "SELECT i FROM Issue i WHERE i.vm = :vm"), 42 @NamedQuery(name = "Issue.findByProductversion", query = "SELECT i FROM Issue i WHERE i.productversion = :productversion"), 43 @NamedQuery(name = "Issue.findByComponent", query = "SELECT i FROM Issue i WHERE i.component = :component"), 44 @NamedQuery(name = "Issue.findBySubcomponent", query = "SELECT i FROM Issue i WHERE i.subcomponent = :subcomponent"), 45 @NamedQuery(name = "Issue.findByAssignto", query = "SELECT i FROM Issue i WHERE i.assignto = :assignto"), 46 @NamedQuery(name = "Issue.findByOperatingsystem", query = "SELECT i FROM Issue i WHERE i.operatingsystem = :operatingsystem"), 47 @NamedQuery(name = "Issue.findByIssuezillaid", query = "SELECT i FROM Issue i WHERE i.issuezillaid = :issuezillaid")}) 48 public class Issue implements Serializable { 49 50 51 @Id 52 @Column(name = "ID", nullable = false) 53 private Integer id; 54 @Column(name = "SUMMARY") 55 private String summary; 56 @Column(name = "VM") 57 private String vm; 58 @Column(name = "PRODUCTVERSION") 59 private String productversion; 60 @Column(name = "COMPONENT") 61 private String component; 62 @Column(name = "SUBCOMPONENT") 63 private String subcomponent; 64 @Column(name = "ASSIGNTO") 65 private String assignto; 66 @Column(name = "OPERATINGSYSTEM") 67 private String operatingsystem; 68 @Column(name = "ISSUEZILLAID") 69 private Integer issuezillaid; 70 @OneToOne(cascade = CascadeType.ALL, mappedBy = "issue") 71 private Stacktrace stacktrace; 72 @OneToMany(cascade = CascadeType.ALL, mappedBy = "issue") 73 private Collection <Comment> commentCollection; 74 @OneToOne(cascade = CascadeType.ALL, mappedBy = "issue") 75 private Hashcodes hashcodes; 76 77 78 public Issue() { 79 } 80 81 public Issue(Integer id) { 82 this.id = id; 83 } 84 85 public Integer getId() { 86 return id; 87 } 88 89 public void setId(Integer id) { 90 this.id = id; 91 } 92 93 public String getSummary() { 94 return summary; 95 } 96 97 public void setSummary(String summary) { 98 this.summary = summary; 99 } 100 101 public String getVm() { 102 return vm; 103 } 104 105 public void setVm(String vm) { 106 this.vm = vm; 107 } 108 109 public String getProductversion() { 110 return productversion; 111 } 112 113 public void setProductversion(String productversion) { 114 this.productversion = productversion; 115 } 116 117 public String getComponent() { 118 return component; 119 } 120 121 public void setComponent(String component) { 122 this.component = component; 123 } 124 125 public String getSubcomponent() { 126 return subcomponent; 127 } 128 129 public void setSubcomponent(String subcomponent) { 130 this.subcomponent = subcomponent; 131 } 132 133 public String getAssignto() { 134 return assignto; 135 } 136 137 public void setAssignto(String assignto) { 138 this.assignto = assignto; 139 } 140 141 public String getOperatingsystem() { 142 return operatingsystem; 143 } 144 145 public void setOperatingsystem(String operatingsystem) { 146 this.operatingsystem = operatingsystem; 147 } 148 149 public Integer getIssuezillaid() { 150 return issuezillaid; 151 } 152 153 public void setIssuezillaid(Integer issuezillaid) { 154 this.issuezillaid = issuezillaid; 155 } 156 157 public Stacktrace getStacktrace() { 158 return stacktrace; 159 } 160 161 public void setStacktrace(Stacktrace stacktrace) { 162 this.stacktrace = stacktrace; 163 } 164 165 public Collection <Comment> getCommentCollection() { 166 return commentCollection; 167 } 168 169 public void setCommentCollection(Collection <Comment> commentCollection) { 170 this.commentCollection = commentCollection; 171 } 172 173 public Hashcodes getHashcodes() { 174 return hashcodes; 175 } 176 177 public void setHashcodes(Hashcodes hashcodes) { 178 this.hashcodes = hashcodes; 179 } 180 181 @Override 182 public int hashCode() { 183 int hash = 0; 184 185 hash += (id != null ? id.hashCode() 186 : 0); 187 return hash; 188 } 189 190 @Override 191 public boolean equals(Object object) { 192 if (!(object instanceof Issue)) { 193 return false; 194 } 195 Issue other = (Issue) object; 196 197 if (this.id != other.id && 198 (this.id == null || !this.id.equals(other.id))) 199 return false; 200 return true; 201 } 202 203 @Override 204 public String toString() { 205 return "test.Issue[id=" + id + "]"; 206 } 207 208 } 209 | Popular Tags |