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.core.cmp.jpa;
18:
19: public class BillPk {
20: private long billNumber;
21: private long billVersion;
22: private long billRevision;
23:
24: public BillPk() {
25:
26: }
27:
28: public BillPk(long number, long version, long revision) {
29: this .billNumber = number;
30: this .billVersion = version;
31: this .billRevision = revision;
32: }
33:
34: public long getBillNumber() {
35: return this .billNumber;
36: }
37:
38: public void setBillNumber(long number) {
39: this .billNumber = number;
40: }
41:
42: public long getBillVersion() {
43: return this .billVersion;
44: }
45:
46: public void setBillVersion(long version) {
47: this .billVersion = version;
48: }
49:
50: public long getBillRevision() {
51: return this .billRevision;
52: }
53:
54: public void setBillRevision(long revision) {
55: this .billRevision = revision;
56: }
57:
58: public boolean equals(Object obj) {
59: if (obj == this )
60: return true;
61:
62: if (!(obj instanceof BillPk))
63: return false;
64:
65: BillPk pk = (BillPk) obj;
66:
67: if (billNumber != pk.billNumber)
68: return false;
69:
70: if (billVersion != pk.billVersion)
71: return false;
72:
73: if (billRevision != pk.billRevision)
74: return false;
75:
76: return true;
77: }
78:
79: public int hashCode() {
80: return (billNumber + "." + billVersion + "." + billRevision)
81: .hashCode();
82: }
83: }
|