KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > test > legacy > CompositeIdId


1 /*
2  * Created on 20-Dec-2004
3  *
4  */

5 package org.hibernate.test.legacy;
6
7 import java.io.Serializable JavaDoc;
8
9 /**
10  * @author max
11  *
12  */

13 public class CompositeIdId implements Serializable JavaDoc {
14
15     String JavaDoc system;
16     String JavaDoc id;
17     String JavaDoc name;
18     CompositeElement composite;
19     
20     
21     public String JavaDoc getId() {
22         return id;
23     }
24     public void setId(String JavaDoc id) {
25         this.id = id;
26     }
27     public String JavaDoc getSystem() {
28         return system;
29     }
30     public void setSystem(String JavaDoc system) {
31         this.system = system;
32     }
33     public String JavaDoc getName() {
34         return name;
35     }
36     public void setName(String JavaDoc name) {
37         this.name = name;
38     }
39     
40     /* (non-Javadoc)
41      * @see java.lang.Object#equals(java.lang.Object)
42      */

43     public boolean equals(Object JavaDoc obj) {
44         // not totally NP or type safe equals, but enough for the unittests.
45
CompositeIdId o = (CompositeIdId) obj;
46         if(o==null) return false;
47         return o.getSystem().equals(getSystem()) && o.getId().equals(getId());
48     }
49     public CompositeElement getComposite() {
50         return composite;
51     }
52     public void setComposite(CompositeElement composite) {
53         this.composite = composite;
54     }
55 }
56
Popular Tags