KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > hints > CC


1 /*
2  * CC.java
3  *
4  * Created on June 19, 2006, 5:08 PM
5  *
6  * To change this template, choose Tools | Template Manager
7  * and open the template in the editor.
8  */

9
10 package hints;
11
12 import java.io.Serializable JavaDoc;
13
14 import javax.persistence.Entity;
15 import javax.persistence.GeneratedValue;
16 import javax.persistence.GenerationType;
17 import javax.persistence.Id;
18
19 /**
20  *
21  * @author jindra
22  */

23 @Entity
24 public class CC implements Serializable JavaDoc {
25
26     CC cc;
27     
28     
29     @Id
30     @GeneratedValue(strategy = GenerationType.AUTO)
31     private Long JavaDoc id;
32     
33     /**
34      * Creates a new instance of CC
35      */

36     public CC() {
37     }
38
39     public Long JavaDoc getId() {
40         return id;
41     }
42
43     public void setId(Long JavaDoc id) {
44         this.id = id;
45     }
46
47     public int hashCode() {
48         int hash = 0;
49         hash += (this.id != null ? this.id.hashCode() : 0);
50         return hash;
51     }
52
53     public boolean equals(Object JavaDoc object) {
54         // TODO: Warning - this method won't work in the case the id fields are not set
55
if (!(object instanceof CC)) {
56             return false;
57         }
58         CC other = (CC)object;
59         if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) return false;
60         return true;
61     }
62
63     public String JavaDoc toString() {
64         return "hints.C[id=" + id + "]";
65     }
66     
67 }
68
Popular Tags