01: /**
02: *
03: * Licensed to the Apache Software Foundation (ASF) under one or more
04: * contributor license agreements. See the NOTICE file distributed with
05: * this work for additional information regarding copyright ownership.
06: * The ASF licenses this file to You under the Apache License, Version 2.0
07: * (the "License"); you may not use this file except in compliance with
08: * the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS,
14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: */package org.apache.openejb.test.entity.cmp;
18:
19: import java.io.Serializable;
20:
21: public class ComplexCmpBeanPk implements Serializable {
22: private static final long serialVersionUID = 6963768936882986623L;
23: public String firstName;
24: public String lastName;
25:
26: public ComplexCmpBeanPk() {
27: }
28:
29: public ComplexCmpBeanPk(String firstName, String lastName) {
30: this .firstName = firstName;
31: this .lastName = lastName;
32: }
33:
34: public boolean equals(Object o) {
35: if (this == o)
36: return true;
37: if (o == null || getClass() != o.getClass())
38: return false;
39:
40: ComplexCmpBeanPk that = (ComplexCmpBeanPk) o;
41:
42: if (firstName != null ? !firstName.equals(that.firstName)
43: : that.firstName != null)
44: return false;
45: if (lastName != null ? !lastName.equals(that.lastName)
46: : that.lastName != null)
47: return false;
48:
49: return true;
50: }
51:
52: public int hashCode() {
53: int result;
54: result = (firstName != null ? firstName.hashCode() : 0);
55: result = 31 * result
56: + (lastName != null ? lastName.hashCode() : 0);
57: return result;
58: }
59:
60: public String toString() {
61: return "ComplexCmpBeanPk[ " + firstName + " " + lastName + " ]";
62: }
63: }
|