KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * Checkissuezilla.java
3  *
4  * Created on 9 February 2007, 22:23
5  *
6  * To change this template, choose Tools | Template Manager
7  * and open the template in the editor.
8  */

9
10 package org.netbeans.modules.exceptions.entity;
11
12 import java.io.Serializable JavaDoc;
13 import java.util.Date JavaDoc;
14 import javax.persistence.Column;
15 import javax.persistence.Entity;
16 import javax.persistence.Id;
17 import javax.persistence.JoinColumn;
18 import javax.persistence.NamedQueries;
19 import javax.persistence.NamedQuery;
20 import javax.persistence.OneToOne;
21 import javax.persistence.Table;
22 import javax.persistence.Temporal;
23 import javax.persistence.TemporalType;
24
25 /**
26  *
27  * @author honza
28  */

29 @Entity
30 @Table(name = "checkissuezilla")
31 @NamedQueries({@NamedQuery(name = "Checkissuezilla.findById", query = "SELECT c FROM Checkissuezilla c WHERE c.id = :id"),
32         @NamedQuery(name = "Checkissuezilla.findByStartTime", query = "SELECT c FROM Checkissuezilla c WHERE c.startTime = :startTime")})
33 public class Checkissuezilla implements Serializable JavaDoc {
34     
35     /** Creates a new instance of Checkissuezilla */
36         @Id
37     @Column(name = "Id", nullable = false)
38     private Integer JavaDoc id;
39     @Column(name = "StartTime")
40     @Temporal(TemporalType.TIMESTAMP)
41     private Date JavaDoc startTime;
42     @JoinColumn(name = "Id", referencedColumnName = "ID", insertable = false, updatable = false)
43     @OneToOne
44     private Issue issue;
45
46     /** Creates a new instance of Checkissuezilla */
47     public Checkissuezilla() {
48     }
49     
50     public Checkissuezilla(Integer JavaDoc id) {
51         this.id = id;
52     }
53
54     public Integer JavaDoc getId() {
55         return id;
56     }
57
58     public void setId(Integer JavaDoc id) {
59         this.id = id;
60     }
61
62     public Date JavaDoc getStartTime() {
63         return startTime;
64     }
65
66     public void setStartTime(Date JavaDoc startTime) {
67         this.startTime = startTime;
68     }
69
70     public Issue getIssue() {
71         return issue;
72     }
73
74     public void setIssue(Issue issue) {
75         this.issue = issue;
76     }
77
78     @Override JavaDoc
79     public int hashCode() {
80         int hash = 0;
81
82         hash += (id != null ? id.hashCode()
83                             : 0);
84         return hash;
85     }
86
87     @Override JavaDoc
88     public boolean equals(Object JavaDoc object) {
89         if (!(object instanceof Checkissuezilla)) {
90             return false;
91         }
92         Checkissuezilla other = (Checkissuezilla) object;
93
94         if (this.id != other.id &&
95             (this.id == null || !this.id.equals(other.id)))
96             return false;
97         return true;
98     }
99
100     @Override JavaDoc
101     public String JavaDoc toString() {
102         return "test.Checkissuezilla[id=" + id + "]";
103     }
104
105 }
106
Popular Tags