KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > cmp2 > fkmapping > ejb > ExamenationPK


1 /*
2  * Generated by XDoclet - Do not edit!
3  */

4 package org.jboss.test.cmp2.fkmapping.ejb;
5
6 /**
7  * Primary key for Examenation.
8  */

9 public class ExamenationPK
10    extends java.lang.Object JavaDoc
11    implements java.io.Serializable JavaDoc
12 {
13    private int _hashCode = 0;
14    private StringBuffer JavaDoc _toStringValue = null;
15
16    public java.lang.String JavaDoc examId;
17
18    public ExamenationPK()
19    {
20    }
21
22    public ExamenationPK( java.lang.String JavaDoc examId )
23    {
24       this.examId = examId;
25    }
26
27    public java.lang.String JavaDoc getExamId()
28    {
29       return examId;
30    }
31
32    public void setExamId(java.lang.String JavaDoc examId)
33    {
34       this.examId = examId;
35       _hashCode = 0;
36    }
37
38    public int hashCode()
39    {
40       if( _hashCode == 0 )
41       {
42          if (this.examId != null) _hashCode += this.examId.hashCode();
43       }
44
45       return _hashCode;
46    }
47
48    public boolean equals(Object JavaDoc obj)
49    {
50       if( !(obj instanceof org.jboss.test.cmp2.fkmapping.ejb.ExamenationPK) )
51          return false;
52
53       org.jboss.test.cmp2.fkmapping.ejb.ExamenationPK pk = (org.jboss.test.cmp2.fkmapping.ejb.ExamenationPK)obj;
54       boolean eq = true;
55
56       if( obj == null )
57       {
58          eq = false;
59       }
60       else
61       {
62          if( this.examId == null && ((org.jboss.test.cmp2.fkmapping.ejb.ExamenationPK)obj).getExamId() == null )
63          {
64             eq = true;
65          }
66          else
67          {
68             if( this.examId == null || ((org.jboss.test.cmp2.fkmapping.ejb.ExamenationPK)obj).getExamId() == null )
69             {
70                eq = false;
71             }
72             else
73             {
74                eq = eq && this.examId.equals( pk.examId );
75             }
76          }
77       }
78
79       return eq;
80    }
81
82    /** @return String representation of this pk in the form of [.field1.field2.field3]. */
83    public String JavaDoc toString()
84    {
85       if( _toStringValue == null )
86       {
87          _toStringValue = new StringBuffer JavaDoc("[.");
88          _toStringValue.append(this.examId).append('.');
89          _toStringValue.append(']');
90       }
91
92       return _toStringValue.toString();
93    }
94
95 }
96
Popular Tags