KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > exceptions > entity > Issue


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 package org.netbeans.modules.exceptions.entity;
20
21 import java.io.Serializable JavaDoc;
22 import java.util.Collection JavaDoc;
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 /**
34  *
35  * @author Jan Horvath
36  */

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 JavaDoc {
49     
50     /** Creates a new instance of Issue */
51         @Id
52     @Column(name = "ID", nullable = false)
53     private Integer JavaDoc id;
54     @Column(name = "SUMMARY")
55     private String JavaDoc summary;
56     @Column(name = "VM")
57     private String JavaDoc vm;
58     @Column(name = "PRODUCTVERSION")
59     private String JavaDoc productversion;
60     @Column(name = "COMPONENT")
61     private String JavaDoc component;
62     @Column(name = "SUBCOMPONENT")
63     private String JavaDoc subcomponent;
64     @Column(name = "ASSIGNTO")
65     private String JavaDoc assignto;
66     @Column(name = "OPERATINGSYSTEM")
67     private String JavaDoc operatingsystem;
68     @Column(name = "ISSUEZILLAID")
69     private Integer JavaDoc issuezillaid;
70     @OneToOne(cascade = CascadeType.ALL, mappedBy = "issue")
71     private Stacktrace stacktrace;
72     @OneToMany(cascade = CascadeType.ALL, mappedBy = "issue")
73     private Collection JavaDoc<Comment> commentCollection;
74     @OneToOne(cascade = CascadeType.ALL, mappedBy = "issue")
75     private Hashcodes hashcodes;
76
77     /** Creates a new instance of Issue */
78     public Issue() {
79     }
80     
81     public Issue(Integer JavaDoc id) {
82         this.id = id;
83     }
84
85     public Integer JavaDoc getId() {
86         return id;
87     }
88
89     public void setId(Integer JavaDoc id) {
90         this.id = id;
91     }
92
93     public String JavaDoc getSummary() {
94         return summary;
95     }
96
97     public void setSummary(String JavaDoc summary) {
98         this.summary = summary;
99     }
100
101     public String JavaDoc getVm() {
102         return vm;
103     }
104
105     public void setVm(String JavaDoc vm) {
106         this.vm = vm;
107     }
108
109     public String JavaDoc getProductversion() {
110         return productversion;
111     }
112
113     public void setProductversion(String JavaDoc productversion) {
114         this.productversion = productversion;
115     }
116
117     public String JavaDoc getComponent() {
118         return component;
119     }
120
121     public void setComponent(String JavaDoc component) {
122         this.component = component;
123     }
124
125     public String JavaDoc getSubcomponent() {
126         return subcomponent;
127     }
128
129     public void setSubcomponent(String JavaDoc subcomponent) {
130         this.subcomponent = subcomponent;
131     }
132
133     public String JavaDoc getAssignto() {
134         return assignto;
135     }
136
137     public void setAssignto(String JavaDoc assignto) {
138         this.assignto = assignto;
139     }
140
141     public String JavaDoc getOperatingsystem() {
142         return operatingsystem;
143     }
144
145     public void setOperatingsystem(String JavaDoc operatingsystem) {
146         this.operatingsystem = operatingsystem;
147     }
148
149     public Integer JavaDoc getIssuezillaid() {
150         return issuezillaid;
151     }
152
153     public void setIssuezillaid(Integer JavaDoc 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 JavaDoc<Comment> getCommentCollection() {
166         return commentCollection;
167     }
168
169     public void setCommentCollection(Collection JavaDoc<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 JavaDoc
182     public int hashCode() {
183         int hash = 0;
184
185         hash += (id != null ? id.hashCode()
186                             : 0);
187         return hash;
188     }
189
190     @Override JavaDoc
191     public boolean equals(Object JavaDoc 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 JavaDoc
204     public String JavaDoc toString() {
205         return "test.Issue[id=" + id + "]";
206     }
207
208 }
209
Popular Tags