KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > ejb > cmr > EmployeeData


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

4 package test.ejb.cmr;
5
6 /**
7  * Data object for Employee.
8  * @xdoclet-generated at 16-04-05
9  * @copyright The XDoclet Team
10  * @author XDoclet
11  * @version 1.2.3
12  */

13 public class EmployeeData
14    extends java.lang.Object JavaDoc
15    implements java.io.Serializable JavaDoc
16 {
17    private java.lang.Integer JavaDoc id;
18    private java.lang.String JavaDoc name;
19
20   /* begin value object */
21    private test.ejb.cmr.EmployeeValue EmployeeValue = null;
22
23    public test.ejb.cmr.EmployeeValue getEmployeeValue()
24    {
25       if( EmployeeValue == null )
26       {
27           EmployeeValue = new test.ejb.cmr.EmployeeValue();
28       }
29       try
30          {
31             EmployeeValue.setId( getId() );
32             EmployeeValue.setName( getName() );
33                    }
34          catch (Exception JavaDoc e)
35          {
36             throw new javax.ejb.EJBException JavaDoc(e);
37          }
38
39       return EmployeeValue;
40    }
41
42    public void setEmployeeValue( test.ejb.cmr.EmployeeValue valueHolder )
43    {
44
45       try
46       {
47          setName( valueHolder.getName() );
48       }
49       catch (Exception JavaDoc e)
50       {
51          throw new javax.ejb.EJBException JavaDoc(e);
52       }
53    }
54
55   /* end value object */
56
57    public EmployeeData()
58    {
59    }
60
61    public EmployeeData( java.lang.Integer JavaDoc id,java.lang.String JavaDoc name )
62    {
63       setId(id);
64       setName(name);
65    }
66
67    public EmployeeData( EmployeeData otherData )
68    {
69       setId(otherData.getId());
70       setName(otherData.getName());
71
72    }
73
74    public java.lang.Integer JavaDoc getPrimaryKey() {
75      return getId();
76    }
77
78    public java.lang.Integer JavaDoc getId()
79    {
80       return this.id;
81    }
82    public void setId( java.lang.Integer JavaDoc id )
83    {
84       this.id = id;
85    }
86
87    public java.lang.String JavaDoc getName()
88    {
89       return this.name;
90    }
91    public void setName( java.lang.String JavaDoc name )
92    {
93       this.name = name;
94    }
95
96    public String JavaDoc toString()
97    {
98       StringBuffer JavaDoc str = new StringBuffer JavaDoc("{");
99
100       str.append("id=" + getId() + " " + "name=" + getName());
101       str.append('}');
102
103       return(str.toString());
104    }
105
106    public boolean equals( Object JavaDoc pOther )
107    {
108       if( pOther instanceof EmployeeData )
109       {
110          EmployeeData lTest = (EmployeeData) pOther;
111          boolean lEquals = true;
112
113          if( this.id == null )
114          {
115             lEquals = lEquals && ( lTest.id == null );
116          }
117          else
118          {
119             lEquals = lEquals && this.id.equals( lTest.id );
120          }
121          if( this.name == null )
122          {
123             lEquals = lEquals && ( lTest.name == null );
124          }
125          else
126          {
127             lEquals = lEquals && this.name.equals( lTest.name );
128          }
129
130          return lEquals;
131       }
132       else
133       {
134          return false;
135       }
136    }
137
138    public int hashCode()
139    {
140       int result = 17;
141
142       result = 37*result + ((this.id != null) ? this.id.hashCode() : 0);
143
144       result = 37*result + ((this.name != null) ? this.name.hashCode() : 0);
145
146       return result;
147    }
148
149 }
150
Popular Tags