KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > test > component > A


1 package org.hibernate.test.component;
2
3 import java.util.Map JavaDoc;
4
5 public class A {
6
7     public int id;
8     public Map JavaDoc dynComp;
9
10     public A() {
11         this(-1);
12     }
13
14     public A(int id) {
15         this.id = id;
16     }
17     
18     public Map JavaDoc getDynComp() {
19         return dynComp;
20     }
21     
22     public void setDynComp(Map JavaDoc dynComp) {
23         this.dynComp = dynComp;
24     }
25     
26     public int getId() {
27         return id;
28     }
29     
30     public void setId(int id) {
31         this.id = id;
32     }
33     
34     public boolean equals(Object JavaDoc obj) {
35         if ( !( obj instanceof A ) ) return false;
36         return id == ( (A) obj ).id;
37     }
38     
39     public int hashCode() {
40         return id == -1 ? super.hashCode() : id;
41     }
42 }
43
Popular Tags